aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2015-10-26 16:14:17 +1100
committerNeil Hodgson <nyamatongwe@gmail.com>2015-10-26 16:14:17 +1100
commit3c8520786fc9b35283d6e55eb1b4b85005a0803e (patch)
tree9a2695ac2d50bc8108370ef934ffb5f8fb390615
parent7858a1aa837cbc21964922351908a8e07099cf27 (diff)
downloadscintilla-mirror-3c8520786fc9b35283d6e55eb1b4b85005a0803e.tar.gz
Avoid possibility of ScintillaCocoa receiving idles after deallocation by severing the
connection from TimerTarget back to ScintillaCocoa and releasing the notification queue.
-rw-r--r--cocoa/ScintillaCocoa.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index 9cb48e5c8..31538aea4 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -334,6 +334,18 @@ const CGFloat paddingHighlightY = 2;
//--------------------------------------------------------------------------------------------------
/**
+ * Method called by owning ScintillaCocoa object when it is destroyed.
+ */
+- (void) ownerDestroyed
+{
+ mTarget = NULL;
+ [notificationQueue release];
+ notificationQueue = nil;
+}
+
+//--------------------------------------------------------------------------------------------------
+
+/**
* Method called by a timer installed by ScintillaCocoa. This two step approach is needed because
* a native Obj-C class is required as target for the timer.
*/
@@ -408,6 +420,7 @@ ScintillaCocoa::ScintillaCocoa(SCIContentView* view, SCIMarginView* viewMargin)
ScintillaCocoa::~ScintillaCocoa()
{
Finalise();
+ [timerTarget ownerDestroyed];
[timerTarget release];
}