diff options
author | Makoto Kato <m_kato@ga2.so-net.ne.jp> | 2018-02-22 12:11:53 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-14 11:07:35 +0100 |
commit | 9da00ab58ed6af96a160c848f86b2db2c0dff547 (patch) | |
tree | a1d479f92743430201ad6f219214e37dd78d69c9 | |
parent | c0ea2166b946daaad3b2b85b68c5570f9f7822d7 (diff) | |
download | uxp-9da00ab58ed6af96a160c848f86b2db2c0dff547.tar.gz |
Bug 1437087 - Call Disconnect on Unlink of cycle collector. r=masayuki, a=RyanVM
-rw-r--r-- | editor/libeditor/EditorBase.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/libeditor/EditorBase.cpp b/editor/libeditor/EditorBase.cpp index b793f39b8c..0c4a2a41d1 100644 --- a/editor/libeditor/EditorBase.cpp +++ b/editor/libeditor/EditorBase.cpp @@ -175,7 +175,14 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(EditorBase) NS_IMPL_CYCLE_COLLECTION_UNLINK(mEditorObservers) NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocStateListeners) NS_IMPL_CYCLE_COLLECTION_UNLINK(mEventTarget) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mEventListener) + + if (tmp->mEventListener) { + EditorEventListener* listener = + reinterpret_cast<EditorEventListener*>(tmp->mEventListener.get()); + listener->Disconnect(); + tmp->mEventListener = nullptr; + } + NS_IMPL_CYCLE_COLLECTION_UNLINK(mSavedSel); NS_IMPL_CYCLE_COLLECTION_UNLINK(mRangeUpdater); NS_IMPL_CYCLE_COLLECTION_UNLINK_END |