Bug 1139469 - Guard against a null compositor loop during startup on B2G. r=botond

This commit is contained in:
Kartikaya Gupta 2015-03-20 15:28:04 -04:00
parent 5fb347354a
commit a89786d06f

View File

@ -56,6 +56,12 @@ APZThreadUtils::RunOnControllerThread(Task* aTask)
// On B2G the controller thread is the compositor thread, and this function
// is always called from the libui thread or the main thread.
MessageLoop* loop = CompositorParent::CompositorLoop();
if (!loop) {
// Could happen on startup
NS_WARNING("Dropping task posted to controller thread\n");
delete aTask;
return;
}
MOZ_ASSERT(MessageLoop::current() != loop);
loop->PostTask(FROM_HERE, aTask);
#else