This bug is originally reported to ubuntu bug tracking system:
https://launchpad.net/distros/ubuntu/+source/xdrawchem/+bug/71851
"Only I installed it and I tried to write a formula with the text tool, when clicked in the work area, program was closed"
I found a reason for this and it seems that there are couple of unassigned variables which are causing problems like this.
And here's a patch for fixing this.
--- /tmp/4WSajx4Z6Z/xdrawchem-1.9.9/xdrawchem/render2d.cpp 2005-06-08 06:59:48.000000000 +0300
+++ /tmp/WOorQ8ZnWf/xdrawchem-1.9.9/xdrawchem/render2d.cpp 2006-11-15 21:09:19.000000000 +0200
@@ -37,6 +37,8 @@
renderWidth = 750;
dbuffer.resize(renderWidth, renderHeight);
directdraw = false;
+ text_drag = false;
+ start_drag = NULL;
resize(renderWidth, renderHeight);
outputDevice = OUTPUT_SCREEN;
diff -Nru /tmp/4WSajx4Z6Z/xdrawchem-1.9.9/xdrawchem/render2d_text.cpp /tmp/WOorQ8ZnWf/xdrawchem-1.9.9/xdrawchem/render2d_text.cpp
--- /tmp/4WSajx4Z6Z/xdrawchem-1.9.9/xdrawchem/render2d_text.cpp 2005-08-05 06:05:50.000000000 +0300
+++ /tmp/WOorQ8ZnWf/xdrawchem-1.9.9/xdrawchem/render2d_text.cpp 2006-11-15 21:09:19.000000000 +0200
@@ -208,7 +208,7 @@
Drawable *no = c->FindNearestObject(e, distobj);
if (localtext != 0) { // handle moves when there is a current object
- if (text_drag == true) {
+ if (text_drag == true && start_drag) {
localtext->Select(start_drag, e);
repaint(false);
return;
Diff:
Patchtested and accepted. Sorry it took so long!