|
template<class C , class Functor >
Schedule a call to be executed on the main thread. With this template function a call can be scheduled to run asynchronously on the main thread like so: try { boost::shared_ptr<ObjectType> obj(get_object_sharedptr()); host->ScheduleOnMainThread(obj, boost::bind(&ObjectType::method, obj, arg1, arg2)); } catch (const FB::script_error&) { // The call will throw this exception if the browser is shutting down and it cannot // be completed. } Note that the first parameter should be a shared_ptr to the object the call is made on; this is then used to create a weak_ptr so that if the object goes away before the call is made the call can fail silently instead of crashing the browser.
Definition at line 224 of file CrossThreadCall.h. |
Generated on 19 Jun 2013 for FireBreath by
1.6.1
Labels
