[GTK] Insta-crash when closing browser with inspector window opened
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2012 20:12:38 +0000 (20:12 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2012 20:12:38 +0000 (20:12 +0000)
commit2379673de140bf570e339ecb186d4d470c75b731
tree7191d828d9db304c24f61a25e2af59a9730bef28
parent2317951c523c95facccf580625cb06026263c743
[GTK] Insta-crash when closing browser with inspector window opened
https://bugs.webkit.org/show_bug.cgi?id=50744

Reviewed by Martin Robinson.

Source/WebKit/gtk:

* GNUmakefile.am:
* WebCoreSupport/InspectorClientGtk.cpp:
(WebKit::InspectorClient::releaseFrontendPage): also let go of the
frontend client when releasing the frontend page;
(WebKit::InspectorFrontendClient::~InspectorFrontendClient(): Call releaseFrontendPage()
like other ports do instead of just disconnectFrontendClient().
(WebKit::InspectorFrontendClient::destroyInspectorWindow): Use GRefPtr for the
inspector ref.
(WebKit::InspectorFrontendClient::bringToFront): Adjust for GRefPtr usage.
(WebKit::InspectorFrontendClient::attachWindow): Ditto.
(WebKit::InspectorFrontendClient::detachWindow): Ditto.
(WebKit::InspectorFrontendClient::inspectedURLChanged): Ditto.
* WebCoreSupport/InspectorClientGtk.h:
(InspectorFrontendClient): Use GRefPtr for inspector member.
* tests/testwebinspector.c: Added. Test that killing a WebView with the inspector
open does not crash, and that closing and reinspecting works.
(quitLoop):
(consoleMessageCallback):
(inspectElementCallback):
(closeInspector):
(showInspector):
(test_webkit_web_inspector_close_and_inspect):
(test_webkit_web_inspector_destroy_inspected_web_view):
(main):

LayoutTests:

* platform/gtk/Skipped: unskip inspector/debugger/open-close-open.html,
which now passes.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106831 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/gtk/Skipped
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/GNUmakefile.am
Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
Source/WebKit/gtk/tests/testwebinspector.c [new file with mode: 0644]