42 place = new Throwable();
43 } else {
44 place = null;
45 }
46 }
47 public UnsafeXDisposerRecord(String name, long ... unsafe_ptrs) {
48 this.unsafe_ptrs = unsafe_ptrs;
49 this.x_ptrs = null;
50 this.name = name;
51 if (XlibWrapper.isBuildInternal) {
52 place = new Throwable();
53 } else {
54 place = null;
55 }
56 }
57
58 public void dispose() {
59 XToolkit.awtLock();
60 try {
61 if (!disposed) {
62 if (XlibWrapper.isBuildInternal && "Java2D Disposer".equals(Thread.currentThread().getName()) && log.isLoggable(PlatformLogger.WARNING)) {
63 if (place != null) {
64 log.warning(name + " object was not disposed before finalization!", place);
65 } else {
66 log.warning(name + " object was not disposed before finalization!");
67 }
68 }
69
70 if (unsafe_ptrs != null) {
71 for (long l : unsafe_ptrs) {
72 if (l != 0) {
73 unsafe.freeMemory(l);
74 }
75 }
76 }
77 if (x_ptrs != null) {
78 for (long l : x_ptrs) {
79 if (l != 0) {
80 if (Native.getLong(l) != 0) {
81 XlibWrapper.XFree(Native.getLong(l));
82 }
|
42 place = new Throwable();
43 } else {
44 place = null;
45 }
46 }
47 public UnsafeXDisposerRecord(String name, long ... unsafe_ptrs) {
48 this.unsafe_ptrs = unsafe_ptrs;
49 this.x_ptrs = null;
50 this.name = name;
51 if (XlibWrapper.isBuildInternal) {
52 place = new Throwable();
53 } else {
54 place = null;
55 }
56 }
57
58 public void dispose() {
59 XToolkit.awtLock();
60 try {
61 if (!disposed) {
62 if (XlibWrapper.isBuildInternal && "Java2D Disposer".equals(Thread.currentThread().getName()) && log.isLoggable(PlatformLogger.Level.WARNING)) {
63 if (place != null) {
64 log.warning(name + " object was not disposed before finalization!", place);
65 } else {
66 log.warning(name + " object was not disposed before finalization!");
67 }
68 }
69
70 if (unsafe_ptrs != null) {
71 for (long l : unsafe_ptrs) {
72 if (l != 0) {
73 unsafe.freeMemory(l);
74 }
75 }
76 }
77 if (x_ptrs != null) {
78 for (long l : x_ptrs) {
79 if (l != 0) {
80 if (Native.getLong(l) != 0) {
81 XlibWrapper.XFree(Native.getLong(l));
82 }
|