diff options
author | das <das@noemail.net> | 2005-05-19 13:27:26 (GMT) |
---|---|---|
committer | das <das@noemail.net> | 2005-05-19 13:27:26 (GMT) |
commit | 11ba32b3a3b5c5a75a66fe3cab37a5dcb0c9e5d4 (patch) | |
tree | 652eee1d964ae9e411018b717164481bc6041437 | |
parent | 70abd25e8fd4218d661173ee2b0e2d91c56cba99 (diff) | |
download | tcl-11ba32b3a3b5c5a75a66fe3cab37a5dcb0c9e5d4.zip tcl-11ba32b3a3b5c5a75a66fe3cab37a5dcb0c9e5d4.tar.gz tcl-11ba32b3a3b5c5a75a66fe3cab37a5dcb0c9e5d4.tar.bz2 |
* macosx/tclMacOSXNotify.c (Tcl_InitNotifier): fixed crashing
CFRelease of runLoopSource in Tcl_InitNotifier (reported by Zoran):
CFRunLoopAddSource doesn't CFRetain, so can only CFRelease the
runLoopSource in Tcl_FinalizeNotifier.
FossilOrigin-Name: a8c0c897b74a40e4318fa3d9981f05f5394a27d5
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | macosx/tclMacOSXNotify.c | 4 |
2 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2005-05-19 Daniel Steffen <das@users.sourceforge.net> + + * macosx/tclMacOSXNotify.c (Tcl_InitNotifier): fixed incorrect + CFRelease of runLoopSource in Tcl_InitNotifier (reported by Zoran). + CFRunLoopAddSource doesn't CFRetain, so moved the CFRelease to + Tcl_FinalizeNotifier. + 2005-05-18 Don Porter <dgp@users.sourceforge.net> * generic/tclBasic.c (Tcl_ExprBoolean): Rewrite as wrapper around diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c index 9de3c98..e091888 100644 --- a/macosx/tclMacOSXNotify.c +++ b/macosx/tclMacOSXNotify.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.1 2005/05/14 20:46:46 das Exp $ + * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.2 2005/05/19 13:27:28 das Exp $ */ #ifdef HAVE_COREFOUNDATION /* Traditional unix select-based notifier @@ -248,7 +248,6 @@ Tcl_InitNotifier() Tcl_Panic("Tcl_InitNotifier: could not create CFRunLoopSource."); } CFRunLoopAddSource(runLoop, runLoopSource, kCFRunLoopCommonModes); - CFRelease(runLoopSource); tsdPtr->runLoopSource = runLoopSource; tsdPtr->runLoop = runLoop; } @@ -363,6 +362,7 @@ Tcl_FinalizeNotifier(clientData) tsdPtr->runLoop = NULL; /* Remove runLoopSource from all CFRunLoops and release it */ CFRunLoopSourceInvalidate(tsdPtr->runLoopSource); + CFRelease(runLoopSource); tsdPtr->runLoopSource = NULL; } UNLOCK_NOTIFIER; |