[geany/geany-plugins] 841d4c: GeniusPaste: Free resources earlier

Colomban Wendling git-noreply at xxxxx
Mon Aug 6 17:12:01 UTC 2012


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Thu, 12 Jul 2012 15:28:54
Commit:      841d4c83adba7cba4f81cc528efff9ad2efa7f55
             https://github.com/geany/geany-plugins/commit/841d4c83adba7cba4f81cc528efff9ad2efa7f55

Log Message:
-----------
GeniusPaste: Free resources earlier


Modified Paths:
--------------
    geniuspaste/src/geniuspaste.c

Modified: geniuspaste/src/geniuspaste.c
8 files changed, 5 insertions(+), 3 deletions(-)
===================================================================
@@ -296,6 +296,8 @@ static void paste(GeanyDocument * doc, const gchar * website)
 
     }
 
+    g_free(f_content);
+
     user_agent = g_strconcat(PLUGIN_NAME, " ", PLUGIN_VERSION, " / Geany ", GEANY_VERSION, NULL);
     session = soup_session_async_new_with_options(SOUP_SESSION_USER_AGENT, user_agent, NULL);
     g_free(user_agent);
@@ -306,6 +308,9 @@ static void paste(GeanyDocument * doc, const gchar * website)
     status = soup_session_send_message(session, msg);
     p_url = g_strdup(msg->response_body->data);
 
+    g_object_unref(session);
+    g_object_unref(msg);
+
     if(status == SOUP_STATUS_OK)
     {
 
@@ -400,10 +405,7 @@ static void paste(GeanyDocument * doc, const gchar * website)
                             "Error code: %d\n"), status);
     }
 
-    g_free(f_content);
     g_free(p_url);
-    g_object_unref(session);
-    g_object_unref(msg);
 }
 
 static void item_activate(GtkMenuItem * menuitem, gpointer gdata)


@@ Diff output truncated at 100000 characters. @@


--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).



More information about the Plugins-Commits mailing list