aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-10-04 22:07:27 +0200
committerThomas White <taw@bitwiz.org.uk>2011-10-04 22:07:27 +0200
commit71d3e037a6934fbb4b57aed30c77efcc1efff3b0 (patch)
tree462e50601db65b357eca2cb52524e08ed89f80e5 /src/mainwindow.c
parenta32c1aa48a60f0d20a2dc237508ec9c2b5dcd729 (diff)
Allow deselect_object() to delete empty objects safely
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r--src/mainwindow.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c
index df9ce49..d115ec3 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -369,7 +369,8 @@ static gint set_tool_sig(GtkWidget *widget, GtkRadioAction *action,
struct presentation *p)
{
if ( p->editing_object != NULL ) {
- p->cur_tool->deselect(p->editing_object, p->cur_tool);
+ int d = p->cur_tool->deselect(p->editing_object, p->cur_tool);
+ if ( d ) p->editing_object = NULL;
}
switch ( gtk_radio_action_get_current_value(action) )