On 20/06/2013 at 11:36, xxxxxxxx wrote:
Thanks Robert and Niklas,
just to clarify, the bitmaps are "global" to the GeDialog class. So they're class level variables - I should have been a bit clearer there. They do have the same names as bitmaps in other classes but I didn't think that would matter? They're just drawn once in the constructor, used in the Draw() function where/when needed, and freed/destroyed in the deconstructor. Just got into the habit of making bitmaps in the constructor if they only need drawing once.
Re the memory, I don't mind looking after that, though I admit I'm not entirely clear on how all the alloc/dealloc works yet. That's still a lesson in progress!
The thing I found is that using prints to the console, it's clear that Cinema gets to the first BaseBitmap::Free(bmp) line in the deconstructor, then crashes. So no prints occur after that line.
WP.
UPDATE: OK I've added an "= NULL" first before freeing them. Not sure why it works without that in one part of the plugin, but another needs the nulling. Anyway, for the purposes of this posting, answer found.