[WK2][EFL] Free Ewk_Intent calloc'd memory with free() instead of delete
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 06:24:19 +0000 (06:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2012 06:24:19 +0000 (06:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=90433

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-07-02
Reviewed by Kenneth Rohde Christiansen.

Free calloc'd memory with free() instead of delete in Ewk_Intent.
Add blank lines before return statements for consistency.

* UIProcess/API/efl/ewk_intent.cpp:
(ewk_intent_unref):
(ewk_intent_action_get):
(ewk_intent_type_get):
(ewk_intent_service_get):
(ewk_intent_suggestions_get):
(ewk_intent_extra_get):
(ewk_intent_extra_names_get):
(ewk_intent_new):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121731 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/efl/ewk_intent.cpp

index 658165e..ee2bb93 100644 (file)
@@ -1,3 +1,23 @@
+2012-07-02  Christophe Dumez  <christophe.dumez@intel.com>
+
+        [WK2][EFL] Free Ewk_Intent calloc'd memory with free() instead of delete
+        https://bugs.webkit.org/show_bug.cgi?id=90433
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Free calloc'd memory with free() instead of delete in Ewk_Intent.
+        Add blank lines before return statements for consistency.
+
+        * UIProcess/API/efl/ewk_intent.cpp:
+        (ewk_intent_unref):
+        (ewk_intent_action_get):
+        (ewk_intent_type_get):
+        (ewk_intent_service_get):
+        (ewk_intent_suggestions_get):
+        (ewk_intent_extra_get):
+        (ewk_intent_extra_names_get):
+        (ewk_intent_new):
+
 2012-07-02  Martin Robinson  <mrobinson@igalia.com>
 
         [TextureMapper] The TextureMapper should support edge-distance anti-antialiasing
index f94863e..a5e201a 100644 (file)
@@ -82,7 +82,7 @@ void ewk_intent_unref(Ewk_Intent* intent)
     eina_stringshare_del(intent->action);
     eina_stringshare_del(intent->type);
     eina_stringshare_del(intent->service);
-    delete intent;
+    free(intent);
 #endif
 }
 
@@ -94,6 +94,7 @@ const char* ewk_intent_action_get(const Ewk_Intent* intent)
     WKRetainPtr<WKStringRef> wkAction(AdoptWK, WKIntentDataCopyAction(wkIntent));
     Ewk_Intent* ewkIntent = const_cast<Ewk_Intent*>(intent);
     eina_stringshare_replace(&ewkIntent->action, toImpl(wkAction.get())->string().utf8().data());
+
     return intent->action;
 #else
     return 0;
@@ -108,6 +109,7 @@ const char* ewk_intent_type_get(const Ewk_Intent* intent)
     WKRetainPtr<WKStringRef> wkType(AdoptWK, WKIntentDataCopyType(wkIntent));
     Ewk_Intent* ewkIntent = const_cast<Ewk_Intent*>(intent);
     eina_stringshare_replace(&ewkIntent->type, toImpl(wkType.get())->string().utf8().data());
+
     return intent->type;
 #else
     return 0;
@@ -122,6 +124,7 @@ const char* ewk_intent_service_get(const Ewk_Intent* intent)
     WKRetainPtr<WKURLRef> wkService(AdoptWK, WKIntentDataCopyService(wkIntent));
     Ewk_Intent* ewkIntent = const_cast<Ewk_Intent*>(intent);
     eina_stringshare_replace(&ewkIntent->service, toImpl(wkService.get())->string().utf8().data());
+
     return intent->service;
 #else
     return 0;
@@ -140,6 +143,7 @@ Eina_List* ewk_intent_suggestions_get(const Ewk_Intent* intent)
         WKURLRef wkSuggestion = static_cast<WKURLRef>(WKArrayGetItemAtIndex(wkSuggestions.get(), i));
         listOfSuggestions = eina_list_append(listOfSuggestions, strdup(toImpl(wkSuggestion)->string().utf8().data()));
     }
+
     return listOfSuggestions;
 #else
     return 0;
@@ -156,6 +160,7 @@ char* ewk_intent_extra_get(const Ewk_Intent* intent, const char* key)
     String value = toImpl(wkValue.get())->string();
     if (value.isEmpty())
         return 0;
+
     return strdup(value.utf8().data());
 #else
     return 0;
@@ -175,6 +180,7 @@ Eina_List* ewk_intent_extra_names_get(const Ewk_Intent* intent)
         WKStringRef wkKey = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkKeys.get(), i));
         listOfKeys = eina_list_append(listOfKeys, strdup(toImpl(wkKey)->string().utf8().data()));
     }
+
     return listOfKeys;
 #else
     return 0;
@@ -189,6 +195,7 @@ Ewk_Intent* ewk_intent_new(WKIntentDataRef intentData)
     Ewk_Intent* ewkIntent = static_cast<Ewk_Intent*>(calloc(1, sizeof(Ewk_Intent)));
     ewkIntent->__ref = 1;
     ewkIntent->wkIntent = intentData;
+
     return ewkIntent;
 }
 #endif