Skip to content

Commit

Permalink
Fixed crash on closing window
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeshkova committed Jul 8, 2014
1 parent e5a1ea6 commit 175a095
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion dom/events/EventStateManager.cpp
Expand Up @@ -259,6 +259,7 @@ NS_INTERFACE_MAP_END

static uint32_t sESMInstanceCount = 0;
static bool sPointerEventEnabled = false;
static bool sPrefInitialized = false;

int32_t EventStateManager::sUserInputEventDepth = 0;
bool EventStateManager::sNormalLMouseEventInProcess = false;
Expand Down Expand Up @@ -337,8 +338,9 @@ EventStateManager::Init()

observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, true);

if (sESMInstanceCount == 1) {
if (!sPrefInitialized) {
Prefs::Init();
sPrefInitialized = true;
}

return NS_OK;
Expand Down
7 changes: 4 additions & 3 deletions embedding/embedlite/embedthread/EmbedLitePuppetWidget.cpp
Expand Up @@ -171,14 +171,15 @@ EmbedLitePuppetWidget::Destroy()

mOnDestroyCalled = true;

Base::OnDestroy();
Base::Destroy();
nsIWidget* topWidget = GetTopLevelWidget();
if (mLayerManager && topWidget == this) {
mLayerManager->Destroy();
}
mParent = nullptr;
mLayerManager = nullptr;

Base::OnDestroy();
Base::Destroy();
mParent = nullptr;
mEmbed = nullptr;
mChild = nullptr;

Expand Down

0 comments on commit 175a095

Please sign in to comment.