Do not use G_LOG_LEVEL_ERROR. Makes claws crash
authorMichael Rasmussen <mir@datanom.net>
Thu, 15 Nov 2018 22:06:29 +0000 (23:06 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 12 Feb 2019 18:38:09 +0000 (19:38 +0100)
Signed-off-by: Michael Rasmussen <mir@datanom.net>
src/plugins/litehtml_viewer/http.cpp
src/plugins/litehtml_viewer/lh_widget.cpp

index 3cfa36ecde3b96a73abb7ec0d32e366234139e70..e6547ebffd9b95ecadb7e1823fea1de91d4ab596 100644 (file)
@@ -30,7 +30,7 @@ size_t http::curl_write_data(char* ptr, size_t size, size_t nmemb, void* data_pt
     char *input = (char *) g_realloc(data->memory, data->size + realsize + 1);
     if(input == NULL) {
         /* out of memory! */
-        g_log(NULL, G_LOG_LEVEL_ERROR, "not enough memory (realloc returned NULL)");
+        g_log(NULL, G_LOG_LEVEL_WARNING, "not enough memory (realloc returned NULL)");
         return 0;
     }
     
index 432a1699eae72d7741e32d77599f7678fbcc6231..ec96a16d7708e8b58448e11268802f9bfaee2173 100644 (file)
@@ -150,14 +150,14 @@ GdkPixbuf *lh_widget::get_image(const litehtml::tchar_t* url, bool redraw_on_rea
 
        g_log(NULL, G_LOG_LEVEL_MESSAGE, "Loading... %s", url);
 
-    http http_loader;
-    GInputStream *image = http_loader.load_url(url, &error);
+       http http_loader;
+       GInputStream *image = http_loader.load_url(url, &error);
     
        if (!image) return NULL;
        
        pixbuf = gdk_pixbuf_new_from_stream(image, NULL, &error);
        if (error) {
-           g_log(NULL, G_LOG_LEVEL_ERROR, "lh_widget::get_image: Could not create pixbuf %s", error->message);
+           g_log(NULL, G_LOG_LEVEL_WARNING, "lh_widget::get_image: Could not create pixbuf %s", error->message);
            //g_object_unref(pixbuf);
            pixbuf = NULL;
            g_clear_error(&error);
@@ -403,7 +403,7 @@ static gboolean button_release_event(GtkWidget *widget, GdkEventButton *event,
                             w->m_clicked_url.c_str(),
                             GDK_CURRENT_TIME, &error);
                 if (error) {
-                    g_log(NULL, G_LOG_LEVEL_ERROR, "Failed opening url(%s): %s", w->m_clicked_url, error->message);
+                    g_log(NULL, G_LOG_LEVEL_WARNING, "Failed opening url(%s): %s", w->m_clicked_url, error->message);
                     g_clear_error(&error);
                 }
         }