[WK2] API::UserContentURLPattern creation functions should return Ref<>
[WebKit-https.git] / Source / WebKit2 / Shared / API / c / WKUserContentURLPattern.cpp
index 9f9b836..ceedc76 100644 (file)
@@ -39,8 +39,7 @@ WKTypeID WKUserContentURLPatternGetTypeID()
 
 WKUserContentURLPatternRef WKUserContentURLPatternCreate(WKStringRef patternRef)
 {
-    RefPtr<API::UserContentURLPattern> userContentURLPattern = API::UserContentURLPattern::create(toImpl(patternRef)->string());
-    return toAPI(userContentURLPattern.release().leakRef());
+    return toAPI(&API::UserContentURLPattern::create(toImpl(patternRef)->string()).leakRef());
 }
 
 WKStringRef WKUserContentURLPatternCopyHost(WKUserContentURLPatternRef urlPatternRef)