Index: Source/web/PopupMenuChromium.cpp |
diff --git a/Source/web/PopupMenuChromium.cpp b/Source/web/PopupMenuChromium.cpp |
index 053e716d3572d27b36f9dfddafd539f269f46039..b0257e67b9e08373a103134af794f606080ed03c 100644 |
--- a/Source/web/PopupMenuChromium.cpp |
+++ b/Source/web/PopupMenuChromium.cpp |
@@ -47,12 +47,26 @@ PopupMenuChromium::PopupMenuChromium(LocalFrame& frame, PopupMenuClient* client) |
PopupMenuChromium::~PopupMenuChromium() |
{ |
+#if !ENABLE(OILPAN) |
haraken
2014/09/29 14:16:37
Can we add an assert to oilpan builds to verify th
sof
2014/10/02 14:03:54
Done.
|
+ dispose(); |
+#endif |
+} |
+ |
+void PopupMenuChromium::dispose() |
+{ |
// When the PopupMenuChromium is destroyed, the client could already have been deleted. |
if (m_popup) |
m_popup->disconnectClient(); |
hide(); |
} |
+void PopupMenuChromium::trace(Visitor* visitor) |
+{ |
+ visitor->trace(m_frameView); |
+ visitor->trace(m_popup); |
+ PopupMenu::trace(visitor); |
+} |
+ |
void PopupMenuChromium::show(const FloatQuad& controlPosition, const IntSize& controlSize, int index) |
{ |
if (!m_popup) { |
@@ -77,6 +91,11 @@ void PopupMenuChromium::updateFromElement() |
void PopupMenuChromium::disconnectClient() |
{ |
m_popupClient = 0; |
+#if ENABLE(OILPAN) |
+ // Cannot be done during finalization, so instead done when the |
+ // render object is destroyed and disconnected. |
+ dispose(); |
haraken
2014/09/29 14:16:37
How about making non-oilpan builds call dispose()
sof
2014/10/02 14:03:54
That's always preferable and I suspect that might
|
+#endif |
} |
} // namespace blink |