tuannv19 / idoubs

Automatically exported from code.google.com/p/idoubs
0 stars 0 forks source link

Memory leaks from doubango threads (ANSI-C code) #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
According to Instrument, there is memory leaks. This is caused by threads 
created by doubango frameworks (ANSI-C). As they are not created using 
objective c you must explicitly declare an autorelease pool.

Original issue reported on code.google.com by imsframe...@gmail.com on 21 Sep 2010 at 5:50

GoogleCodeExporter commented 8 years ago
According to this: 
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation
/Classes/NSAutoreleasePool_Class/Reference/Reference.html

If you are creating secondary threads using the POSIX thread APIs instead of 
NSThread objects, you cannot use Cocoa, including NSAutoreleasePool, unless 
Cocoa is in multithreading mode. 
 Cocoa enters multithreading mode only after detaching its first NSThread object. 
To use Cocoa on secondary POSIX threads, your application must first detach at 
least one NSThread object, which can immediately exit. 
You can test whether Cocoa is in multithreading mode with the NSThread class 
method isMultiThreaded.

Original comment by boss...@yahoo.fr on 25 Sep 2010 at 3:33

GoogleCodeExporter commented 8 years ago
Fixed in revision 25

Original comment by boss...@yahoo.fr on 5 Oct 2010 at 11:47