IRC Log Viewer » #firebreath » 2012-10-16

IRC Nick Time (GMT-7) Message
jshanab 09:10 I just discovered that using getRootJSAPI automatically tries to create a jsapi if it is null. This causes a problem for me. Is there anyway to get the pointer so I can check it for null to avoid sending a message to JS during a shutdown of the plugin?
taxilian 09:10 don't remember; check the code
jshanab 09:10 I am in PluginCore and do not see it but wondering if my code is up to date enough
JSAPIptr is private and it seems like there is no way, is it ok to cache it after plugin ready and call releaseRootJSAPI and then set my own copy of m_api to null, kinda sync them?
taxilian 09:10 what problem are you actually trying to solve?
jshanab 09:10 I have about 30 instances of the plugin on a page and changeing pages results in a long delay becasue calling stop from my onWindowDetach is blocking. I was trying to speed up the shutdown and also make the stop non-blocking for those few instances that take a bit to stop. I get an assertion during shutdown of the weakhost expire
taxilian 09:10 meaning that something isn't releasing the host in time
why don't you just set a flag in the PluginCore::shutdown method and use that?
instead of calling getRootJSAPI
jshanab 09:10 It says that is called after the detach event. I am not sure the call to getRootJSAPI is the problem, but i am shuting down a progressbar thread and it sends to javascript. the send uses getRootJSAPI to send the event. I can't cache it cause it could go away??? and if I use getRootJSAPI it would try to recreate it
hang on, I forgot I subclassed that method!
I mean the create
I can use that
taxilian 10:10 glad you figured it out =]
jshanab 10:10 I think I did, time will tell. A rude awakening this week. We have benn using the single process FF so we can debug. Our customer pointed out, quite emphatically, that he does not. our plugin has started crashing on every browser tab change and minimize in addition to slow shutdown on large camera counts. Tough week
taxilian 10:10 … yeah. you only want to use that when you're debugging
always develop in as close to the same environment as the end user
jshanab 10:10 I know it is probably a direct-X/SDL thing but any ideas on why crash on tab cahnge and min/maximize.
taxilian 10:10 just that it's probably window/drawing related
jshanab 10:10 Yeah our tester got pulled off onto other task. Shot ourself in the foot
jshanab 10:10 Taxillian. The comments say the onPluginReady() is called after createJSAPI. Is that always true?
taxilian 10:10 yes
jshanab 10:10 I will clear my breakpoints and try again. VS2010 is lying
taxilian 10:10 lol
well, it's possible there is a bug
jshanab 10:10 I removed a getRootJSAPI call replacing it with a member variable set in createJSAPI and it is null and crashes!
taxilian 10:10 sounds fun
jshanab 10:10 in setReady there is a setting of a variable called method. it returns null so it skips calling the getRootJSAPI in a delayedInvoke. requardles of the try/catch result or weather it calls getRootJSAPI, it continues on to onPluginReady, Am i reading that code correct? it can call onPluginReady and never call createJSAPI? I traced from init downward
Ok. It is never explicily called. it is only called from by happenstance of the first call to getRootJSAPI(). So I need to understand why the method var is null in (line 109) of PluginCore::setReady() on my plugin?
Corect me if I am wrong, If there is no onload js function, it does not create the JSAPI before calling onPluginReady
taxilian 11:10 jshanab: hmm; that is possible, I suspect. it will depend on exactly how the browser initializes things
jshanab 11:10 I jut made the first line of onpluginready a call to getRootJSAPI to force it
taxilian 11:10 sounds like a good diea, if that's what you need
jshanab 11:10 I am trying to make the stop of my plugin asynchronous and it is not happening. I spawn a thread to run the stop and I join the thread in my dtor, but I still get weak pointer expired assertion
taxilian 11:10 join the thread in your shutdown method
not in the destructor
jshanab 11:10 ok, I will try that. thanks