diff options
author | Niraj Modi | 2021-05-31 10:51:08 +0000 |
---|---|---|
committer | Niraj Modi | 2021-05-31 13:28:29 +0000 |
commit | 33df33ab19f98affef101785d4617302f3751922 (patch) | |
tree | e1d8eb7e08a7d71ab117ce311af831cd309d3438 | |
parent | 51baf07721891b4be55fb5e78b7a3b74633e3d81 (diff) | |
download | eclipse.platform.swt-33df33ab19f98affef101785d4617302f3751922.tar.gz eclipse.platform.swt-33df33ab19f98affef101785d4617302f3751922.tar.xz eclipse.platform.swt-33df33ab19f98affef101785d4617302f3751922.zip |
Bug 573813 - non disposed widget error on first start
- Handle special case for 'TaskBar.createShellLink()' where Image object
doesn't own the handle
Change-Id: Id066037b5d1fc6892055f679efd02baa71e9788a
Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/181184
Reviewed-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Reviewed-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java index 0ce7708c87..e0bc571bad 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2017 IBM Corporation and others. + * Copyright (c) 2010, 2021 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -167,6 +167,11 @@ IShellLink createShellLink (MenuItem item) { if (item.hBitmap != 0) { Image image2 = Image.win32_new (display, SWT.BITMAP, item.hBitmap); data = image2.getImageData (DPIUtil.getDeviceZoom ()); + /* + * image2 instance doesn't own the handle and shall not be disposed. Make it + * appear disposed to cause leak trackers to ignore it. + */ + image2.handle = 0; } else { data = image.getImageData (DPIUtil.getDeviceZoom ()); } |