Bug 1233812 - Fix possible race in accessing nsAppShell instance; r=snorp
When getting nsAppShell from another thread, there could be a race with nsAppShell being destroyed on the main thread. This patch makes the raw nsAppShell pointer only accessible from the main thread, and use a static mutex to coordinate accessing nsAppShell from other threads.
This commit is contained in:
@@ -77,7 +77,7 @@ AndroidContentController::HandleSingleTap(const CSSPoint& aPoint,
|
||||
|
||||
CSSIntPoint rounded = RoundedToInt(point);
|
||||
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", rounded.x, rounded.y);
|
||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||
nsAppShell::PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||
NS_LITERAL_CSTRING("Gesture:SingleTap"), data));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user