fixed DebugTask when called multiple times
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
package de.unidue.nes.gpu.testframework.tasks;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.highgui.HighGui;
|
||||
import org.opencv.highgui.ImageWindow;
|
||||
|
||||
/**
|
||||
* Task is used for debugging
|
||||
@@ -28,9 +32,22 @@ public class DebugTask implements Task {
|
||||
HighGui.imshow("Image " + i, this.mats[i]);
|
||||
}
|
||||
HighGui.waitKey();
|
||||
|
||||
Map<String, ImageWindow> windows = HighGui.windows;
|
||||
destroyWindows(windows);
|
||||
HighGui.destroyAllWindows();
|
||||
};
|
||||
}
|
||||
|
||||
private void destroyWindows(Map<String, ImageWindow> windows) {
|
||||
for (ImageWindow w : windows.values()) {
|
||||
JFrame frame = w.frame;
|
||||
if (frame != null) {
|
||||
frame.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GpuTask toGpuTask() {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user