Commit 7466be6
committed
[Win32] Clean up disposed images when retrieving image list handle eclipse-platform#2432
Images inside an ImageList may become disposed. For that reason, methods
like indexOf() or add() check for the images inside the list being
disposed to null them. This check is missing in the getHandle() method
used when requesting the ImageList handle for a different zoom, which
can lead to exceptions because of access to a disposed Image instance.
This change adapts the ImageList implementation to always consider that
an image inside the list may have been disposed. The according cleanup
logic is factored out from all places.
Fixes eclipse-platform#24321 parent 1ae0e18 commit 7466be6
File tree
1 file changed
+16
-11
lines changed- bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal
1 file changed
+16
-11
lines changedLines changed: 16 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 54 | + | |
| 55 | + | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
| |||
71 | 69 | | |
72 | 70 | | |
73 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
337 | 342 | | |
338 | 343 | | |
339 | 344 | | |
340 | | - | |
| 345 | + | |
341 | 346 | | |
342 | 347 | | |
343 | 348 | | |
| |||
372 | 377 | | |
373 | 378 | | |
374 | 379 | | |
375 | | - | |
376 | | - | |
377 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
378 | 383 | | |
379 | 384 | | |
380 | 385 | | |
| |||
480 | 485 | | |
481 | 486 | | |
482 | 487 | | |
483 | | - | |
484 | | - | |
485 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
486 | 491 | | |
487 | 492 | | |
488 | 493 | | |
| |||
0 commit comments