From bc5bc24812d14ba6a0d3ceb1722e34d9bf31c4d6 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 19 Feb 2009 20:53:35 +0000 Subject: [PATCH] Fix a crash when removing the label of an included Program Listing. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28563 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetInclude.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 13938aaf90..1814c235e3 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -244,9 +244,10 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd) docstring old_label; if (label_) old_label = label_->getParam("name"); - if (new_label.empty()) + if (new_label.empty()) { delete label_; - else if (label_ && old_label != new_label) { + label_ = 0; + } else if (label_ && old_label != new_label) { label_->updateCommand(new_label); // the label might have been adapted (duplicate) if (new_label != label_->getParam("name")) { -- 2.39.5