Re: [webkit-dev] how to destroy JSObjescts?

2008-11-26 Thread Iulian
This is not what i want. I just want to avoid memory leaks. With JSGarbageCollect is a little better, but not perfect. I'll try to explain my scenario, maybe this will help. I extended GTKLauncher to provide aditional JavaScript objects. Actually i create two objects: One with JSObjectMake(),

Re: [webkit-dev] how to destroy JSObjescts?

2008-11-26 Thread Alexey Proskuryakov
Nov 26, 2008, в 12:23 PM, Iulian написал(а): With JSGarbageCollect() the finalize() function of myStaticObject gets called, but the finalize() function of myDynamicObject doesn't get called. Perhaps the address of myDynamicObject is on the stack when you call JSGarbageCollect()? That

Re: [webkit-dev] how to destroy JSObjescts?

2008-11-26 Thread Iulian
Ok. That doesn't help me. I never call JSValueProtect() to prevent the object from being destroyed. Iulian Alexey Proskuryakov-4 wrote: Perhaps the address of myDynamicObject is on the stack when you call JSGarbageCollect()? That would prevent it from being collected, of course.

Re: [webkit-dev] how to destroy JSObjescts?

2008-11-25 Thread Timothy Hatcher
JavaScript objects and the JavaScriptCore API objects (except JSStringRef) are garbage collected. So sometime after the last reference goes away, they will release their memory. In this case when the global object goes away. If you want to release them, you can call JSObjectDeleteProperty