bug 787704, better to remember addref/release sContent in IMEStateManager, r=masayuki

This commit is contained in:
Olli Pettay 2012-09-20 19:13:18 +03:00
Родитель 6910b3f623
Коммит c1f4a109d4
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -61,7 +61,7 @@ nsIMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
InputContextAction::LOST_FOCUS);
SetIMEState(newState, nullptr, widget, action);
}
sContent = nullptr;
NS_IF_RELEASE(sContent);
sPresContext = nullptr;
OnTextStateBlur(nullptr, nullptr);
return NS_OK;
@ -89,7 +89,7 @@ nsIMEStateManager::OnRemoveContent(nsPresContext* aPresContext,
SetIMEState(newState, nullptr, widget, action);
}
sContent = nullptr;
NS_IF_RELEASE(sContent);
sPresContext = nullptr;
return NS_OK;
@ -172,7 +172,10 @@ nsIMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
SetIMEState(newState, aContent, widget, aAction);
sPresContext = aPresContext;
sContent = aContent;
if (sContent != aContent) {
NS_IF_RELEASE(sContent);
NS_IF_ADDREF(sContent = aContent);
}
return NS_OK;
}