Ecere Software
/
sdk
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0309833
)
ecere/gui/controls/DropBox: Extra safety to avoid crashes
author
Jerome St-Louis
<jerome@ecere.com>
Sat, 28 Mar 2015 09:15:45 +0000
(
05:15
-0400)
committer
Jerome St-Louis
<jerome@ecere.com>
Thu, 15 Oct 2015 00:19:39 +0000
(20:19 -0400)
ecere/src/gui/controls/DropBox.ec
patch
|
blob
|
history
diff --git
a/ecere/src/gui/controls/DropBox.ec
b/ecere/src/gui/controls/DropBox.ec
index
abed8ad
..
aacf773
100644
(file)
--- a/
ecere/src/gui/controls/DropBox.ec
+++ b/
ecere/src/gui/controls/DropBox.ec
@@
-238,12
+238,14
@@
public:
virtual void OnCloseDropDown(Window pullDown)
{
virtual void OnCloseDropDown(Window pullDown)
{
+ incref this;
listBox.visible = false;
if(style.editText)
{
editBox.ActivateEx(true, false, false, false, null, null);
editBox.SelectAll();
}
listBox.visible = false;
if(style.editText)
{
editBox.ActivateEx(true, false, false, false, null, null);
editBox.SelectAll();
}
+ delete this;
}
// Methods
}
// Methods
@@
-868,6
+870,8
@@
private:
bool NotifySelect(ListBox listBox, DataRow row, Modifiers mods)
{
bool NotifySelect(ListBox listBox, DataRow row, Modifiers mods)
{
+ bool result = true;
+ incref this;
Update(null);
// Add code to set text to list box contents if it has an editbox
Update(null);
// Add code to set text to list box contents if it has an editbox
@@
-879,7
+883,10
@@
private:
button.checked = false;
mods.closingDropDown = true;
if(!NotifyClose(master, this))
button.checked = false;
mods.closingDropDown = true;
if(!NotifyClose(master, this))
+ {
+ delete this;
return false;
return false;
+ }
}
currentRow = (row && !row.noneRow) ? row : null;
if(style.editText && style.changeContents)
}
currentRow = (row && !row.noneRow) ? row : null;
if(style.editText && style.changeContents)
@@
-896,7
+903,9
@@
private:
editBox.SelectAll();
}
button.Deactivate();
editBox.SelectAll();
}
button.Deactivate();
- return NotifySelect(master, this, currentRow, mods);
+ result = NotifySelect(master, this, currentRow, mods);
+ delete this;
+ return result;
}
bool NotifyHighlight(ListBox control, DataRow row, Modifiers mods)
}
bool NotifyHighlight(ListBox control, DataRow row, Modifiers mods)