mirror of https://github.com/buggins/dlangui.git
fix resource leak when closing tabs
This commit is contained in:
parent
195a8587be
commit
7490ae0c56
|
@ -382,6 +382,7 @@ class Window {
|
|||
_backgroundColor = 0xFFFFFF;
|
||||
}
|
||||
~this() {
|
||||
debug Log.d("Destroying window");
|
||||
if (_tooltip.popup) {
|
||||
destroy(_tooltip.popup);
|
||||
_tooltip.popup = null;
|
||||
|
|
|
@ -113,7 +113,7 @@ class StringListAdapter : ListAdapter {
|
|||
override Widget itemWidget(int index) {
|
||||
updateStatesLength();
|
||||
if (_widget is null) {
|
||||
_widget = new TextWidget("LIST_ITEM");
|
||||
_widget = new TextWidget("STRING_LIST_ITEM");
|
||||
_widget.styleId = STYLE_LIST_ITEM;
|
||||
} else {
|
||||
if (index == _lastItemIndex)
|
||||
|
|
|
@ -332,7 +332,9 @@ class TabControl : WidgetGroupDefaultDrawing {
|
|||
}
|
||||
int index = _items.indexById(id);
|
||||
if (index >= 0) {
|
||||
_children.remove(index + 1);
|
||||
Widget w = _children.remove(index + 1);
|
||||
if (w)
|
||||
destroy(w);
|
||||
_items.remove(index);
|
||||
if (id.equal(_selectedTabId))
|
||||
_selectedTabId = null;
|
||||
|
|
Loading…
Reference in New Issue