Can't allocate DIB handle error
Hey everyone,
It has been quite a while since I last posted here, this being because it was made very clear that I'm not exactly welcome here anymore. However, I had something important to share... I was recently pondering about the "Can't allocate DIB handle" error for which I've received quite a lot of heat because I could never find what actually caused it... I thought I had at one point, but it appeared that I had not afterwards. This error is thrown by SCAR when it can't allocate a DIB handle, obviously, what this means though, is that Windows won't allow the application to create any more bitmaps. There's few reasons what could possibly trigger this, the only viable reason is that SCAR would be creating bitmaps in it's memory space and not free them afterwards, which eventually would pile up until Windows gets fed up with it and refuses to allow any more to be created. So, I went looking in SCAR's source for any bitmaps I might not be freeing, though me and kaitnieks never really left that many memory leaks and I fixed most of the leaks in there years ago. And my search came up empty. So I started thinking... SCAR's plugin system works in a way that plugins are loaded to share the same memory space SCAR does, and this error has as far as I know only been known to occur for SRL users... So I turned my attention towards the SRL plugins, and I found this: http://villavu.com/repositories/srl-...izzyPlugin.dpr, if you would scroll down to CreateTPAFromBMP, you'll notice a bitmap "Bitmappie", being created without being freed afterwards, now if this function is called repeatedly enough, this would cause the very problem of "Can't allocate DIB handle" in SCAR. So my conclusion is, I'm not sure if it's the actual cause, but I really can't find anything else that could cause it, unless SCAR is actually handling too many bitmaps at once, but that also seems very unlikely, because that would be a shitload of bitmaps... But in any case, it has to be fixed because it creates a serious memory leak in SCAR's memory space.
Yours truly,
Freddy.