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 /editor/libeditor/EditorBase.cpp | |
parent | c0ea2166b946daaad3b2b85b68c5570f9f7822d7 (diff) | |
download | UXP-9da00ab58ed6af96a160c848f86b2db2c0dff547.tar UXP-9da00ab58ed6af96a160c848f86b2db2c0dff547.tar.gz UXP-9da00ab58ed6af96a160c848f86b2db2c0dff547.tar.lz UXP-9da00ab58ed6af96a160c848f86b2db2c0dff547.tar.xz UXP-9da00ab58ed6af96a160c848f86b2db2c0dff547.zip |
Bug 1437087 - Call Disconnect on Unlink of cycle collector. r=masayuki, a=RyanVM
Diffstat (limited to 'editor/libeditor/EditorBase.cpp')
-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 b793f39b8..0c4a2a41d 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 |