Fixes the bug where the profile was not added when finished.
[WebKit-https.git] / WebCore / page / InspectorController.cpp
index 8dfde38..56165c8 100644 (file)
@@ -1430,7 +1430,9 @@ void InspectorController::stopUserInitiatedProfiling()
     m_recordingUserInitiatedProfile = false;
 
     ExecState* exec = toJSDOMWindow(m_inspectedPage->mainFrame())->globalExec();
-    Profiler::profiler()->stopProfiling(exec, UserInitiatedProfileName);
+    RefPtr<Profile> profile = Profiler::profiler()->stopProfiling(exec, UserInitiatedProfileName);
+    if (profile)
+        addProfile(profile);
 }
 
 static void addHeaders(JSContextRef context, JSObjectRef object, const HTTPHeaderMap& headers, JSValueRef* exception)