2009-12-17 41 views
3

我的應用程序泄漏我真的無法理解,任何人都可以幫我嗎?0x0內存泄露[iphone]

儀器堆棧跟蹤:

 0 libSystem.B.dylib calloc 
     1 WebCore CurrentThreadContext() 
     2 WebCore WKSetCurrentGraphicsContext 
     3 UIKit -[NSString(UIStringDrawing) drawAtPoint:forWidth:withFont:lineBreakMode:letterSpacing:includeEmoji:] 
     4 UIKit -[NSString(UIStringDrawing) drawAtPoint:forWidth:withFont:lineBreakMode:] 
     5 UIKit -[UILabel _drawTextInRect:baselineCalculationOnly:] 
     6 UIKit -[UILabel drawTextInRect:] 
     7 UIKit -[UILabel drawRect:] 
     8 UIKit -[UIView(CALayerDelegate) drawLayer:inContext:] 
     9 QuartzCore -[CALayer drawInContext:] 
     10 QuartzCore -[CALayer _display] 
     11 QuartzCore -[CALayer display] 
     12 QuartzCore CALayerDisplayIfNeeded 
     13 QuartzCore CA::Context::commit_transaction(CA::Transaction*) 
     14 QuartzCore CA::Transaction::commit() 
     15 QuartzCore CA::Transaction::release_thread(void*) 
     16 libSystem.B.dylib _pthread_tsd_cleanup 
     17 libSystem.B.dylib _pthread_exit 
     18 Foundation +[NSThread exit] 
     19 Foundation __NSThread__main__ 
     20 libSystem.B.dylib _pthread_body 
     21 TestApp 0x0 

回答

2

你在幹什麼泄漏出現過嗎?有些事情可能會導致泄漏,例如,嘗試不從主線程進行UI更改。

+0

你的意思是不是來自主線程?我的大部分繪圖都是從View(Will/Did)出現的方法完成的。或者從線程填充的UITableViewController。例如,如果使用NSOperationQueue,則爲 – Thys 2009-12-18 08:42:05

+0

。所有操作都在parralel線程中。試圖在我的操作中顯示警報時,我有內存泄漏。 – Morion 2009-12-18 10:39:11

2

這是在模擬器或物理設備?

如果是在模擬器上,請針對物理設備進行泄漏測試。已知該模擬器具有設備沒有的奇怪的泄漏。

如果這是一個物理設備上,我也茫然地解釋:\

+0

這是一個物理設備-.- – Thys 2009-12-17 16:14:28

+0

你看,看看是否有類似的東西,錯誤報告?如果沒有,我會報告。這看起來不像是由你的應用程序引起的。 – 2009-12-17 16:16:08

0

在webkit中看起來像是一個漏洞......除了向Apple提供報告之外,您可能沒有多少工作可做。

0

我認爲Morion是對的。永遠不要用主線程以外的其他線程對UI進行操作。偶然發生這種情況時,我發生了最有趣的事情。

你說:

大多數我的繪畫是從視圖進行(會/ DID)出現的方法。或者從線程填充的UITableViewController。

因此,控制器被另一個線程填充,這意味着該圖形也在這個「其他」線程中執行。嘗試使用performSelectorOnMainThread:withObject:waitUntilDone:

到這裏看看:Reference Documentation