From: Eric K. <eri...@gm...> - 2008-03-15 15:18:30
|
Sat Mar 15 15:13:39 GMT 2008 Eric Kow <eri...@gm...> * Add withImageData and withPixelBuffer (fixes bug 1003006). Quoting Jules Bean, whose solution I implemented: > 1 image <- imageCreateSized (WX.Size 256 256) > 2 pixels <- imageGetData image > 3 bytes <- peekArray (256*256*3) (castPtr pixels) > > > After line 2 is executed, there is no remaining reference to 'image' in > the program. 'image' is dead, and can be garbage collected. (Although it > may not be at any particular time). If 'image' gets GC'ed, because there > is a ForeignPtr inside, that calls the C++ destructor. The wxImage C++ > destructor believes it owns the data block, so it free()s it, and > 'pixels' is left pointing to a free()ed block. Sat Mar 15 15:16:41 GMT 2008 Eric Kow <eri...@gm...> * Add a test for a possible treeCtrl bug. |