Delayed widget editing, crash avoidance
Make the PoseView stop watching a TextWidget if it's being deleted. Could happen in race conditions for example, if you click to edit the name widget of a pose while the pose is being deleted soon after.
This commit is contained in:
parent
44f900e221
commit
66c09a3554
@ -7137,9 +7137,10 @@ BPoseView::MouseDown(BPoint where)
|
||||
|
||||
|
||||
void
|
||||
BPoseView::SetTextWidgetToCheck(BTextWidget* widget)
|
||||
BPoseView::SetTextWidgetToCheck(BTextWidget* widget, BTextWidget* old)
|
||||
{
|
||||
fTextWidgetToCheck = widget;
|
||||
if (old == NULL || fTextWidgetToCheck == old)
|
||||
fTextWidgetToCheck = widget;
|
||||
}
|
||||
|
||||
|
||||
|
@ -425,7 +425,7 @@ class BPoseView : public BView {
|
||||
virtual void AdaptToVolumeChange(BMessage*);
|
||||
virtual void AdaptToDesktopIntegrationChange(BMessage*);
|
||||
|
||||
void SetTextWidgetToCheck(BTextWidget*);
|
||||
void SetTextWidgetToCheck(BTextWidget*, BTextWidget* = NULL);
|
||||
|
||||
protected:
|
||||
// view setup
|
||||
|
@ -78,6 +78,9 @@ BTextWidget::BTextWidget(Model* model, BColumn* column, BPoseView* view)
|
||||
|
||||
BTextWidget::~BTextWidget()
|
||||
{
|
||||
if (fLastClickedTime != 0)
|
||||
fParams.poseView->SetTextWidgetToCheck(NULL, this);
|
||||
|
||||
delete fText;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user