Permalink
Browse files

crash fixes

  • Loading branch information...
1 parent 061fbd1 commit 67973f60b8f58607e2a8eeb65b148df83d18a15f @spencersalazar committed Dec 22, 2012
Showing with 42 additions and 3 deletions.
  1. +12 −3 MAUI/miniAudicle_ui_elements_mac.mm
  2. +12 −0 MAUI/test/memleak.ck
  3. +9 −0 MAUI/test/perry1.ck
  4. +9 −0 MAUI/test/perry2.ck
@@ -195,6 +195,8 @@ - (void)setMasterView:(NSView *)v
withObject:nil
waitUntilDone:YES];
+ native_element = NULL;
+
return TRUE;
}
@@ -307,8 +309,13 @@ - (void)hide
- (void)destroy
{
- [panel close];
- [panel release];
+ if(panel != nil)
+ {
+ [panel close];
+ [panel release];
+ panel = nil;
+ }
+
[self autorelease];
}
@@ -406,6 +413,8 @@ - (void)addElement:(mAUIElement *)e
withObject:nil
waitUntilDone:YES];
+ native_view = NULL;
+
return TRUE;
}
@@ -437,7 +446,7 @@ - (void)addElement:(mAUIElement *)e
if( elements[i] == e )
{
elements[i]->remove_parent( this );
- elements[i] = NULL;
+ elements[i] = NULL; // SPENCERTODO: why not use list<> and remove?
}
}
View
@@ -0,0 +1,12 @@
+
+while(true)
+{
+ MAUI_View myWinder;
+ MAUI_Button butt;
+ butt.name("BUTT!");
+ myWinder.addElement(butt);
+ myWinder.display();
+ 0.25 :: second => now;
+ myWinder.destroy();
+ 0.25 :: second => now;
+}
View
@@ -0,0 +1,9 @@
+MAUI_View myWinder;
+MAUI_Button butt;
+butt.name("BUTT!");
+myWinder.addElement(butt);
+myWinder.display();
+while (butt.state()==0) {
+ 0.01 :: second => now;
+}
+myWinder.destroy();
View
@@ -0,0 +1,9 @@
+
+MAUI_View view;
+MAUI_Button butt;
+butt.name("Butt");
+view.addElement(butt);
+view.display;
+1.0 :: second => now;
+view.destroy;
+

0 comments on commit 67973f6

Please sign in to comment.