summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/test_shell.cc
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-06 01:11:33 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-06 01:11:33 +0000
commita801d3db0f64bfef8645fdf256f216fa79d641a9 (patch)
tree5423d876dcae23c3cf890fd1e827001b9334433b /webkit/tools/test_shell/test_shell.cc
parent51d6096d97d9038f5042b46d61dd0ee5d8a04f4a (diff)
downloadchromium_src-a801d3db0f64bfef8645fdf256f216fa79d641a9.zip
chromium_src-a801d3db0f64bfef8645fdf256f216fa79d641a9.tar.gz
chromium_src-a801d3db0f64bfef8645fdf256f216fa79d641a9.tar.bz2
Handle destruction of test shell properly.
When test shell's destructor runs, it tries to delete its child objects. But when the GTK widgets are destroyed, they also try to delete the associated objects. We don't want both to run. Also, there were a couple of incorrect uses of the GTK API (e.g. destroy-event instead of destroy) that were obfuscating the problem. This fixes a crash on shutdown, so I'm restoring the LoadURL() call in TestShell's destructor. Review URL: http://codereview.chromium.org/13214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6475 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_shell.cc')
-rw-r--r--webkit/tools/test_shell/test_shell.cc44
1 files changed, 24 insertions, 20 deletions
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index d132a7f..7679265 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -124,28 +124,32 @@ TestShell::TestShell()
}
TestShell::~TestShell() {
- // Call GC twice to clean up garbage.
- CallJSGC();
- CallJSGC();
-
- PlatformCleanUp();
-
- StatsTable *table = StatsTable::current();
- if (dump_stats_table_on_exit_) {
- // Dump the stats table.
- printf("<stats>\n");
- if (table != NULL) {
- int counter_max = table->GetMaxCounters();
- for (int index=0; index < counter_max; index++) {
- std::string name(table->GetRowName(index));
- if (name.length() > 0) {
- int value = table->GetRowValue(index);
- printf("%s:\t%d\n", name.c_str(), value);
- }
- }
+ // Navigate to an empty page to fire all the destruction logic for the
+ // current page.
+ LoadURL(L"about:blank");
+
+ // Call GC twice to clean up garbage.
+ CallJSGC();
+ CallJSGC();
+
+ PlatformCleanUp();
+
+ StatsTable *table = StatsTable::current();
+ if (dump_stats_table_on_exit_) {
+ // Dump the stats table.
+ printf("<stats>\n");
+ if (table != NULL) {
+ int counter_max = table->GetMaxCounters();
+ for (int index=0; index < counter_max; index++) {
+ std::string name(table->GetRowName(index));
+ if (name.length() > 0) {
+ int value = table->GetRowValue(index);
+ printf("%s:\t%d\n", name.c_str(), value);
+ }
}
- printf("</stats>\n");
}
+ printf("</stats>\n");
+ }
}
void TestShell::ShutdownTestShell() {