Skip to content

Commit f7c4b78

Browse files
committed
BaseInternalDialog - fix issue if the figure is deleted while the dialog is in waiting state, an error would be given
1 parent 9fcab72 commit f7c4b78

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

widgets/+wt/+abstract/BaseInternalDialog.m

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,19 +316,24 @@ function positionOver(obj, refComp)
316316
obj.IsWaitingForOutput = true;
317317
waitfor(obj,'IsWaitingForOutput',false)
318318

319-
% Produce output
319+
% Complete the wait action
320+
% Is the dialog still present?
320321
if isvalid(obj)
322+
323+
% Assign the output
321324
output = obj.Output;
322325
lastAction = obj.LastAction;
326+
327+
% Check for deletion criteria and delete dialog
328+
obj.checkDeletionCriteria()
329+
323330
else
331+
324332
% Dialog or figure was deleted
325333
output = [];
326334
lastAction = "close";
327-
end
328-
329335

330-
% Check for deletion criteria
331-
obj.checkDeletionCriteria()
336+
end
332337

333338
end %function
334339

@@ -403,7 +408,7 @@ function setup(obj)
403408
obj.OuterPanel.ButtonDownFcn = @(~,evt)onTitleButtonDown(obj,evt);
404409

405410
% Close Button
406-
obj.CloseButton = uibutton(obj.OuterPanel);
411+
obj.CloseButton = uibutton(obj);
407412
obj.CloseButton.Text = "";
408413
obj.CloseButton.Tag = "close";
409414
obj.CloseButton.IconAlignment = "center";

0 commit comments

Comments
 (0)