This is because I'm using GMainLoopSource created on the heap and destroyed automatically when reached for the timeout. We should use stack allocated one that will be cancelled when current scope is destroyed.
TEST: ./Tools/gtk/../../WebKitBuild/Release/bin/TestWebKitAPI/WebKit2Gtk/TestResources... (pid=20904) /webkit2/WebKitWebView/resources: OK /webkit2/WebKitWebView/history-cache: OK /webkit2/WebKitWebView/sync-request-on-max-conns: OK /webkit2/WebKitWebResource/loading: OK /webkit2/WebKitWebResource/response: OK /webkit2/WebKitWebResource/mime-type: OK /webkit2/WebKitWebResource/suggested-filename: OK /webkit2/WebKitWebResource/active-uri: OK /webkit2/WebKitWebResource/get-data: OK /webkit2/WebKitWebPage/send-request: ** ERROR:../../Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:709:testWebViewSyncRequestOnMaxConns(SyncRequestOnMaxConnsTest*, gconstpointer)::__lambda2: code should not be reached FAIL GTester: last random seed: R02S24f485eab1e5cd6f16d591e4d82f8a9d (pid=21130) FAIL: ./Tools/gtk/../../WebKitBuild/Release/bin/TestWebKitAPI/WebKit2Gtk/TestResources
Created attachment 248044 [details] Patch
Attachment 248044 [details] did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:710: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:713: More than one command on the same line [whitespace/newline] [4] Total errors found: 2 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Committed r181159: <http://trac.webkit.org/changeset/181159>