instead of using the Imager type typemap entry use the Imager::ImgRef
authorTony Cook <tony@develop-help.com>
Sat, 10 Mar 2007 23:40:45 +0000 (23:40 +0000)
committerTony Cook <tony@develop-help.com>
Sat, 10 Mar 2007 23:40:45 +0000 (23:40 +0000)
type and wrap it.  This avoids the leak in that entry pre Imager 0.56.

RT #24992

Screenshot.pm
Screenshot.xs

index 52e3c81e8bd78c59f20138fb8eed81d854a7efbf..c8ecd4ac50a592d67aabf05e4425bfcfdc850aa5 100644 (file)
@@ -94,8 +94,10 @@ sub screenshot {
     Imager->_set_error(Imager->_error_as_msg());
     return;
   }
-  
-  return $result;
+
+  # RT #24992 - the Imager typemap entry is broken pre-0.56, so
+  # wrap it here
+  return bless { IMG => $result }, "Imager";
 }
 
 sub have_win32 {
index 1892aa11e2038fc22e8b894384bdef51014a2bb7..335b3d44218ddfd1f79c894d63b24b68e5fd11a2 100644 (file)
@@ -16,7 +16,7 @@ PROTOTYPES: DISABLE
 
 #ifdef SS_WIN32
 
-Imager
+Imager::ImgRaw
 imss_win32(hwnd, include_decor = 0, left = 0, top = 0, right = 0, bottom = 0)
        unsigned hwnd
        int include_decor
@@ -29,7 +29,7 @@ imss_win32(hwnd, include_decor = 0, left = 0, top = 0, right = 0, bottom = 0)
 
 #ifdef SS_X11
 
-Imager
+Imager::ImgRaw
 imss_x11(display, window_id, left = 0, top = 0, right = 0, bottom = 0)
         unsigned long display
        int window_id