Skip to content

Instantly share code, notes, and snippets.

@cjxgm
Created February 20, 2017 06:05
Show Gist options
  • Save cjxgm/698c428f9eb42fdd4f7f16f156f64b9a to your computer and use it in GitHub Desktop.
Save cjxgm/698c428f9eb42fdd4f7f16f156f64b9a to your computer and use it in GitHub Desktop.
Dirty fix TeXmacs 1.99.5 crashing/freezing/segfault when closing any dialog that contains a TeXmacs widget (like New Style Font Selection, Log, New Macros / Edit Macros)
diff -Naur TeXmacs-1.99.5-src/src/Plugins/Qt/qt_simple_widget.cpp TeXmacs-1.99.5-src-fix-simple-widget-crash/src/Plugins/Qt/qt_simple_widget.cpp
--- TeXmacs-1.99.5-src/src/Plugins/Qt/qt_simple_widget.cpp 2016-07-08 01:56:55.000000000 +0800
+++ TeXmacs-1.99.5-src-fix-simple-widget-crash/src/Plugins/Qt/qt_simple_widget.cpp 2017-02-20 13:53:30.741575287 +0800
@@ -615,6 +615,10 @@
iterator<pointer> i = iterate(qt_simple_widget_rep::all_widgets);
while (i->busy()) {
qt_simple_widget_rep *w = static_cast<qt_simple_widget_rep*>(i->next());
+ if (w->canvas() == NULL) {
+ all_widgets->remove ((pointer) w);
+ continue;
+ }
if (w->canvas()->isVisible()) w->repaint_invalid_regions();
}
}
@algmyr
Copy link

algmyr commented Mar 3, 2017

Thank you! This actually makes 1.99.5 usable. Hopefully this gets fixed properly soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment