summaryrefslogtreecommitdiff
path: root/src/fltk-images-rgb-pnm.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/fltk-images-rgb-pnm.adb')
-rw-r--r--src/fltk-images-rgb-pnm.adb6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/fltk-images-rgb-pnm.adb b/src/fltk-images-rgb-pnm.adb
index d1b6141..8227cd9 100644
--- a/src/fltk-images-rgb-pnm.adb
+++ b/src/fltk-images-rgb-pnm.adb
@@ -29,13 +29,9 @@ package body FLTK.Images.RGB.PNM is
overriding procedure Finalize
(This : in out PNM_Image) is
begin
- if This.Void_Ptr /= Null_Pointer and then
- This in PNM_Image'Class
- then
+ if This.Void_Ptr /= Null_Pointer and This.Needs_Dealloc then
free_fl_pnm_image (This.Void_Ptr);
- This.Void_Ptr := Null_Pointer;
end if;
- Finalize (RGB_Image (This));
end Finalize;