Posted to tcl by das at Wed Oct 31 17:45:49 GMT 2007view raw

  1. Index: macosx/tkMacOSXInit.c
  2. ===================================================================
  3. RCS file: /cvsroot/tktoolkit/tk/macosx/tkMacOSXInit.c,v
  4. retrieving revision 1.33
  5. diff -u -p -r1.33 tkMacOSXInit.c
  6. --- macosx/tkMacOSXInit.c 6 Sep 2007 19:33:56 -0000 1.33
  7. +++ macosx/tkMacOSXInit.c 31 Oct 2007 17:43:28 -0000
  8. @@ -18,6 +18,8 @@
  9.  
  10. #include "tclInt.h" /* for Tcl_GetStartupScript() & Tcl_SetStartupScript() */
  11.  
  12. +#include <AppKit/NSApplication.h>
  13. +
  14. #include <sys/stat.h>
  15. #include <sys/utsname.h>
  16. #include <mach-o/dyld.h>
  17. @@ -135,6 +137,7 @@ TkpInit(
  18. long osVersion = 0;
  19.  
  20. initialized = 1;
  21. + NSApplicationLoad();
  22.  
  23. /*
  24. * Initialize/check OS version variable for runtime checks.
  25. Index: macosx/tkMacOSXNotify.c
  26. ===================================================================
  27. RCS file: /cvsroot/tktoolkit/tk/macosx/tkMacOSXNotify.c,v
  28. retrieving revision 1.19
  29. diff -u -p -r1.19 tkMacOSXNotify.c
  30. --- macosx/tkMacOSXNotify.c 29 Jun 2007 03:20:02 -0000 1.19
  31. +++ macosx/tkMacOSXNotify.c 31 Oct 2007 17:43:29 -0000
  32. @@ -17,6 +17,8 @@
  33. #include "tkMacOSXPrivate.h"
  34. #include "tkMacOSXEvent.h"
  35. #include <pthread.h>
  36. +#include <pthread.h>
  37. +#include <Foundation/NSAutoreleasePool.h>
  38.  
  39. /*
  40. * The following static indicates whether this module has been initialized
  41. @@ -184,8 +186,12 @@ CarbonEventsCheckProc(clientData, flags)
  42. if (numFound > 4) {
  43. numFound = 4;
  44. }
  45. + if (numFound > 0) {
  46. + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  47. while (numFound > 0 && err == noErr) {
  48. err = TkMacOSXReceiveAndDispatchEvent();
  49. numFound--;
  50. }
  51. + [pool release];
  52. + }
  53. }
  54.