2011-05-03 57 views
2

我想在我的項目中執行線程操作。事情正在起作用,但我得到NSAutoreleaseNoPool(): Object 0x66ad9d0 of class NSConcreteMutableData autoreleased with no pool in place - just leaking pring在我的NSLOG。NSAutoreleaseNoPool():類NSConcreteMutableData的對象0x66ad9d0自動釋放,沒有池到位 - 只是漏水

我的代碼..

NSAutoreleasePool *MyPool = [[NSAutoreleasePool alloc] init]; 
[NSThread detachNewThreadSelector:@selector(insertSyncRec:) toTarget:self withObject:dict]; 
[MyPool drain]; // [MyPool release]; too 

我的日誌信息是:

2011-05-03 17:29:51.262 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd5034d0 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.262 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd504190 of class NSCFString autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.263 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd503930 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.264 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd5066a0 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.265 MLead[7240:7e13] *** __NSAutoreleaseNoPool(): Object 0xd4180e0 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.266 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd507260 of class NSCFString autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.266 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd506a50 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.269 MLead[7240:8407] *** __NSAutoreleaseNoPool(): Object 0xd507af0 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.271 MLead[7240:8407] *** __NSAutoreleaseNoPool(): Object 0xd419a20 of class NSCFString autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.271 MLead[7240:8407] *** __NSAutoreleaseNoPool(): Object 0xd4061f0 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.267 MLead[7240:7e13] *** __NSAutoreleaseNoPool(): Object 0xd418dc0 of class NSCFString autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.272 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xa3f5650 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.272 MLead[7240:7e13] *** __NSAutoreleaseNoPool(): Object 0xd4185c0 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.272 MLead[7240:8407] *** __NSAutoreleaseNoPool(): Object 0xd5068c0 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.281 MLead[7240:8407] *** __NSAutoreleaseNoPool(): Object 0xd508f70 of class NSCFString autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.282 MLead[7240:8407] *** __NSAutoreleaseNoPool(): Object 0xd504b10 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.272 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd41a470 of class NSCFString autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.283 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd41ba60 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.284 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd418eb0 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.284 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd41bc40 of class NSCFString autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.273 MLead[7240:7e13] *** __NSAutoreleaseNoPool(): Object 0xd506db0 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.284 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd41b540 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.285 MLead[7240:8513] *** __NSAutoreleaseNoPool(): Object 0xd5086e0 of class __NSCFData autoreleased with no pool in place - just leaking 
2011-05-03 17:29:51.286 MLead[7240:8407] *** __NSAutoreleaseNoPool(): Object 0xd507c30 of class __NSCFData autoreleased with no pool in place - just leaking 

等..

我缺少什麼.. 很多谷歌上搜索只是我的後發現創建一個新的游泳池..但沒有工作..

在此先感謝..

回答

1

不應該在線程本身內創建池嗎?

1

我也有同樣的問題,而不是將任務附加到一個新的線程嘗試在同一個線程。 [self insertSyncRec:dict];

我解決了我的問題吧

相關問題