[pan2] Fix error found by valgrind: xxx bytes in yyy blocks are definitely lost in loss record 10, 709 of 10



commit 833ccc6d1159c1e8db4709f54d8af8d3df38ed1e
Author: Olaf Seibert <rhialto falu nl>
Date:   Mon Mar 14 20:34:15 2016 +0100

    Fix error found by valgrind: xxx bytes in yyy blocks are definitely lost in loss record 10,709 of 10,844
    
    2,048 bytes in 1 blocks are definitely lost in loss record 10,709 of 10,844
       at 0x4C2DD9F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
       by 0x6D2F637: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4600.2)
       by 0x6D4AA96: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4600.2)
       by 0x6D4ADB6: g_string_insert_len (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4600.2)
       by 0x51FEAA2: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.28)
       by 0x47E452: pan::BodyPane::set_text_from_message(_GMimeMessage*) (body-pane.cc:1273)
       by 0x463B38: pan::GUI::root_realized_cb(_GtkWidget*, void*) (gui.cc:210)
       by 0x6A9D014: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4600.2)
       by 0x6AAF060: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4600.2)
       by 0x6AB7DFB: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4600.2)
       by 0x6AB812E: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4600.2)
       by 0x5290F53: gtk_widget_realize (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.28)

 pan/gui/body-pane.cc |    6 ++++--
 pan/gui/body-pane.h  |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/pan/gui/body-pane.cc b/pan/gui/body-pane.cc
index daa2d95..38d5a37 100644
--- a/pan/gui/body-pane.cc
+++ b/pan/gui/body-pane.cc
@@ -1270,8 +1270,10 @@ BodyPane :: set_text_from_message (GMimeMessage * message)
   GtkTextBuffer* buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(_text));
   GtkTextIter _start, _end;
   gtk_text_buffer_get_bounds (buffer, &_start, &_end);
+#ifdef HAVE_WEBKIT
   char* buf (gtk_text_buffer_get_text (buffer, &_start, &_end, false));
   if (buf) set_html_text(buf);
+#endif
 
   // if there was a picture, scroll to it.
   // otherwise scroll to the top of the body.
@@ -1681,13 +1683,13 @@ BodyPane :: add_attachment_to_toolbar (const char* fn)
   gtk_widget_show_all(_att_toolbar);
 }
 
+#ifdef HAVE_WEBKIT
 void
 BodyPane :: set_html_text (const char* text)
 {
-#ifdef HAVE_WEBKIT
   webkit_web_view_load_string (WEBKIT_WEB_VIEW (_web_view), text, NULL, NULL, "");
-#endif
 }
+#endif
 
 GtkWidget*
 BodyPane :: create_attachments_toolbar (GtkWidget* frame)
diff --git a/pan/gui/body-pane.h b/pan/gui/body-pane.h
index 9b83c48..579757a 100644
--- a/pan/gui/body-pane.h
+++ b/pan/gui/body-pane.h
@@ -125,8 +125,8 @@ namespace pan
       GtkWidget* create_attachments_toolbar(GtkWidget*);
 
     private:
-      void set_html_text (const char* text);
 #ifdef HAVE_WEBKIT
+      void set_html_text (const char* text);
       GtkWidget* _web_view;
 #endif
     private:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]