Skip to content

Commit

Permalink
Control: when disposing/releasing a control, check whether the set fo…
Browse files Browse the repository at this point in the history
…nt is still alive
  • Loading branch information
Thomas Singer authored and tmssngr committed Mar 21, 2024
1 parent 9d59c4e commit 837c55e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2941,6 +2941,14 @@ void release (boolean destroy) {
}
}

@Override
void releaseChildren (boolean destroy) {
if (font != null && font.isDisposed()) {
SWT.error(SWT.ERROR_GRAPHIC_DISPOSED, font.disposeStackTrace);
}
super.releaseChildren(destroy);
}

@Override
void releaseHandle () {
super.releaseHandle ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4756,6 +4756,14 @@ void release (boolean destroy) {
}
}

@Override
void releaseChildren (boolean destroy) {
if (font != null && font.isDisposed()) {
SWT.error(SWT.ERROR_GRAPHIC_DISPOSED, font.disposeStackTrace);
}
super.releaseChildren(destroy);
}

@Override
void releaseHandle () {
super.releaseHandle ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,14 @@ void register () {
display.addControl (handle, this);
}

@Override
void releaseChildren (boolean destroy) {
if (font != null && font.isDisposed()) {
SWT.error(SWT.ERROR_GRAPHIC_DISPOSED, font.disposeStackTrace);
}
super.releaseChildren(destroy);
}

@Override
void releaseHandle () {
super.releaseHandle ();
Expand Down

0 comments on commit 837c55e

Please sign in to comment.