Skip to content

Conversation

@akoch-yatta
Copy link
Contributor

This PR replaces the handle == 0 checks in GC by using isDisposed instead. It was done via search & replace

@akoch-yatta akoch-yatta linked an issue Jun 11, 2025 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Jun 11, 2025

Test Results

   545 files  ±0     545 suites  ±0   31m 29s ⏱️ + 4m 53s
 4 399 tests ±0   4 381 ✅ ±0   18 💤 ±0  0 ❌ ±0 
16 723 runs  ±0  16 583 ✅ ±0  140 💤 ±0  0 ❌ ±0 

Results for commit cbbe0fe. ± Comparison against base commit 67eacca.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A simple cleanup that is obviously fine.
I just wondered: should be take the chance and extract the actual check and error generation into a method checkNonDisposed or the like?

@akoch-yatta akoch-yatta force-pushed the win32-GC-check-isDisposed branch from fe59608 to de53baa Compare June 13, 2025 14:40
@akoch-yatta
Copy link
Contributor Author

A simple cleanup that is obviously fine. I just wondered: should be take the chance and extract the actual check and error generation into a method checkNonDisposed or the like?

Makes sense. I actually thought about that, but didn't do it yet for some reason. I adapted it now

This commit replaces the handle == 0 checks in GC by using isDisposed
instead
@HeikoKlare HeikoKlare force-pushed the win32-GC-check-isDisposed branch from de53baa to cbbe0fe Compare June 13, 2025 15:20
@HeikoKlare HeikoKlare merged commit e39c288 into eclipse-platform:master Jun 13, 2025
17 checks passed

void copyAreaInPixels(Image image, int x, int y) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
checkNonDisposed();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert regarding englisch language, but should it be checkNotDisposed? (like in "check it is not disposed"). I would probably simply name it checkDisposed like here.

@akoch-yatta akoch-yatta deleted the win32-GC-check-isDisposed branch June 16, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace GC isDisposed checks

3 participants