Index: Source/wtf/MainThread.cpp |
diff --git a/Source/wtf/MainThread.cpp b/Source/wtf/MainThread.cpp |
index 83a14aefb290aed59263a3af01fd5e6466dad94f..17b823e9eb24fd1ceb756dfccedaec791f1b501f 100644 |
--- a/Source/wtf/MainThread.cpp |
+++ b/Source/wtf/MainThread.cpp |
@@ -66,9 +66,9 @@ static void callFunctionObject(void* context) |
delete function; |
} |
-void callOnMainThread(const Function<void()>& function) |
+void callOnMainThread(PassOwnPtr<Function<void()>> function) |
{ |
- callOnMainThread(callFunctionObject, new Function<void()>(function)); |
+ callOnMainThread(callFunctionObject, function.leakPtr()); |
} |
bool isMainThread() |