changeset 1862:9c7485b1921c

Fixed object/signal/memory leak on Mac when destroying notebook and window objects... also some minor cleanup.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 05 Mar 2013 05:12:25 +0000
parents c836603d3f14
children 0656c716dc9f
files mac/dw.m
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Fri Mar 01 16:51:08 2013 +0000
+++ b/mac/dw.m	Tue Mar 05 05:12:25 2013 +0000
@@ -819,6 +819,7 @@
 -(void)setRedraw:(int)val { redraw = val; }
 -(int)shown { return shown; }
 -(void)setShown:(int)val { shown = val; }
+-(void)dealloc { dw_signal_disconnect_by_window(self); [super dealloc]; }
 @end
 
 /* Subclass for a render area type */
@@ -912,12 +913,12 @@
         return NO;
     return YES;
 }
-- (void)viewDidMoveToWindow
+-(void)viewDidMoveToWindow
 {
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowResized:) name:NSWindowDidResizeNotification object:[self window]];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeMain:) name:NSWindowDidBecomeMainNotification object:[self window]];
 }
-- (void)dealloc
+-(void)dealloc
 {
     if(windowmenu)
     {
@@ -927,7 +928,7 @@
     dw_signal_disconnect_by_window(self);
     [super dealloc];
 }
-- (void)windowResized:(NSNotification *)notification;
+-(void)windowResized:(NSNotification *)notification;
 {
     NSSize size = [self frame].size;
 
@@ -8274,6 +8275,7 @@
 
         dw_box_pack_start(tmpbox, page, 0, 0, TRUE, TRUE, 0);
         [notepage setView:box];
+        [box autorelease];
     }
 }