hust-marx / firebreath

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

FB::JSAPIAuto objects should be prompted / released when its no more referenced by any JavaScript code. #141

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Brief Description:
FB::JSAPIAuto objects should be prompted / released when its no more referenced 
by any JavaScript code.

Most of the time when the NPObjct gets destroyed we can delete the 
FB::JSAPIAuto objects or atleast prompt the objects that they are not 
referenced by javascript.
This will automate releasing the memory which is not being referenced and hence 
improve on memory footprint of the plugin.

Original issue reported on code.google.com by mital.d....@gmail.com on 9 Feb 2011 at 7:05

GoogleCodeExporter commented 9 years ago
This was a good call; I think this fix gives us the "happy medium" between not 
being able to control our lifecycle and not being able to use the browser's 
lifecycle.  With this fix a returned shared_ptr will be managed by the browser 
-- unless the browserhost or something else excplicitly releases it first, 
which is still an option (an important one).

If you return a weak_ptr, the lifecycle will be managed purely by you.

Fixed in 1.4 branch, will be in RC1

Original comment by taxilian on 10 Feb 2011 at 6:20