summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authordas <das>2005-05-19 13:28:33 (GMT)
committerdas <das>2005-05-19 13:28:33 (GMT)
commit5c0ba9966cd9fdeb4869125d15121e9465dfca55 (patch)
treea740324a680d540dfc9f3850ba3c829832dd3380 /macosx
parent65286b9f063c3c50f48935273423c3157b0c2926 (diff)
downloadtcl-5c0ba9966cd9fdeb4869125d15121e9465dfca55.zip
tcl-5c0ba9966cd9fdeb4869125d15121e9465dfca55.tar.gz
tcl-5c0ba9966cd9fdeb4869125d15121e9465dfca55.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.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tclMacOSXNotify.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c
index bf3b9bc..8cc5af2 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.2.2 2005/05/14 20:52:31 das Exp $
+ * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.1.2.3 2005/05/19 13:28:34 das Exp $
*/
#ifdef HAVE_COREFOUNDATION /* Traditional unix select-based notifier
@@ -249,7 +249,6 @@ Tcl_InitNotifier()
Tcl_Panic("Tcl_InitNotifier: could not create CFRunLoopSource.");
}
CFRunLoopAddSource(runLoop, runLoopSource, kCFRunLoopCommonModes);
- CFRelease(runLoopSource);
tsdPtr->runLoopSource = runLoopSource;
tsdPtr->runLoop = runLoop;
}
@@ -364,6 +363,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;