Author: manolo
Date: 2010-12-08 09:10:05 -0800 (Wed, 08 Dec 2010)
New Revision: 7980
Log:
Fix STR #2277 for crash when DnD of filename to editor.

Modified:
   branches/branch-1.3/src/Fl_x.cxx

Modified: branches/branch-1.3/src/Fl_x.cxx
===================================================================
--- branches/branch-1.3/src/Fl_x.cxx    2010-12-08 14:47:11 UTC (rev 7979)
+++ branches/branch-1.3/src/Fl_x.cxx    2010-12-08 17:10:05 UTC (rev 7980)
@@ -958,15 +958,16 @@
 #ifndef X_HAVE_UTF8_STRING
       text_list = (char**)&portion;
 #else
-      int list_count;
+      int list_count = 0;
       Xutf8TextPropertyToTextList(fl_display, (const 
XTextProperty*)&text_prop, &text_list, &list_count);
+      if (list_count == 0) text_list = (char**)&portion;
 #endif
       int bytesnew = strlen(*text_list)+1; 
       buffer = (unsigned char*)realloc(buffer, bytesread+bytesnew+remaining);
       memcpy(buffer+bytesread, *text_list, bytesnew);
       XFree(portion); 
 #ifdef X_HAVE_UTF8_STRING
-      XFreeStringList(text_list);
+      if (list_count > 0) XFreeStringList(text_list);
 #endif
       bytesread += bytesnew - 1;
       if (!remaining) break;

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to