cocoaTouch/MapConfigViewController.m
changeset 3487 b1d00f1950c8
parent 3463 23c50be687a9
child 3490 016b3172b645
--- a/cocoaTouch/MapConfigViewController.m	Fri May 28 20:13:47 2010 +0000
+++ b/cocoaTouch/MapConfigViewController.m	Mon May 31 19:33:42 2010 +0000
@@ -88,6 +88,7 @@
     int port = randomPort();
     pthread_t thread_id;
     pthread_create(&thread_id, NULL, (void *)GenLandPreview, (void *)port);
+    pthread_detach(thread_id);
     [self engineProtocol:port];
 
     // draw the buffer (1 pixel per component, 0= transparent 1= color)
@@ -128,7 +129,8 @@
     [indicator removeFromSuperview];
     
     [pool release];
-    [NSThread exit];
+    //Invoking this method should be avoided as it does not give your thread a chance to clean up any resources it allocated during its execution.
+    //[NSThread exit];
 
     /*
     // http://developer.apple.com/mac/library/qa/qa2001/qa1037.html
@@ -360,6 +362,9 @@
             mazeCommand = @"e$maze_size 0";
             break;
         default:
+            labelText = nil;
+            templateCommand = nil;
+            mazeCommand = nil;
             break;
     }
     
@@ -402,6 +407,10 @@
             [self sliderChanged:nil];
             self.slider.enabled = YES;
             break;
+        
+        default:
+            mapgen = nil;
+            break;
     }
     self.mapGenCommand = mapgen;
     [self updatePreview];