From: Eric Y. K. <eri...@gm...> - 2008-03-14 10:06:07
|
> I've worked it out. With a little help from malcolmw on #ghc. Excellent! Thanks very much. I learned something new. > Should imageGetData be turned into a 'with-style' function > > Image a -> (Ptr () -> IO b) -> IO b > > which protects the image? Ultimately, this seems like the right thing to do, for all functions that return pointers to underlying bits of data (I am slightly scared that there may be loads of these lurking around). > Is there a workaround I can use in my code like touchPtr? A version of > touchPtr which works on WXObjects? Well, I added image `seq` return () to your demonstrator. Not sure if that really does what we want. I suppose we could augment the PixelBuffer type to include a pointer to the original image. -- Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow> PGP Key ID: 08AC04F9 |