Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,10 @@ void registerResourceWithZoomSupport(Resource resource) {
resourcesWithZoomSupport.add(resource);
}

void deregisterResourceWithZoomSupport(Resource resource) {
resourcesWithZoomSupport.remove(resource);
}

/**
* Destroys the handles of all the resources in the resource tracker by
* identifying the zoom levels which is not valid for any monitor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,7 @@ long initNative(String filename, int zoom) {

@Override
void destroy () {
device.deregisterResourceWithZoomSupport(this);
if (memGC != null) memGC.dispose();
destroyHandle();
memGC = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ void cubicToInPixels(float cx1, float cy1, float cx2, float cy2, float x, float

@Override
void destroy() {
device.deregisterResourceWithZoomSupport(this);
zoomLevelToHandle.values().forEach(Gdip::GraphicsPath_delete);
zoomLevelToHandle.clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ void setImageHandle(Image image, int zoom) {

@Override
void destroy() {
device.deregisterResourceWithZoomSupport(this);
for (long handle: zoomLevelToHandle.values()) {
destroyHandle(handle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ public boolean contains (Point pt) {

@Override
void destroy () {
device.deregisterResourceWithZoomSupport(this);
zoomToHandle.values().forEach(handle -> OS.DeleteObject(handle));
zoomToHandle.clear();
operations.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ static float[] checkTransform(float[] elements) {

@Override
void destroy() {
device.deregisterResourceWithZoomSupport(this);
zoomLevelToHandle.values().forEach(Gdip::Matrix_delete);
zoomLevelToHandle.clear();
}
Expand Down
Loading