DescriptionGetBitmap
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/10/2007 at 08:56, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.111
Platform: Windows ;
Language(s) : C++ ;---------
In the SDK-docu it should be corrected that:BaseBitmap* bmp;
"must not" receive pointer-copies, but preferably
dgb->bmp = my_permanent_picture->GetClone();
The actual description is very confusing (I did allocate a bitmap - only not in MSG_DESCRIPTION_GETBITMAP and not a new for every call; I did ensure that the bitmap will be freed - only not in MSG_DESCRIPTION_GETBITMAP but only when the BaseBitmap-sizes change or on termination).
It took me some debugging iterations through repetitive recursive GETBITMAP-calls to get to the idea not just to pass the pointer, but to provide a copy.
Actually I don't even know if the clone gets freed, or if I loose memory every time.
Greetings
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/10/2007 at 15:35, xxxxxxxx wrote:
"The recipient should allocate a bitmap and assign this pointer. The sender must ensure that the bitmap is freed properly. (Normally this means that CINEMA 4D does the freeing.)"
Sounds pretty clear to me. I think however, that there is a typo. It should say "...and assign to this pointer".
Just put an empty "c4d_debug.txt" into your c4d folder. Then the console window will open with c4d. Once you close c4d, memory leaks will be listed there.
Depending on what you do (for example when you react to the message) the bmp is freed by c4d. Only if you do custom stuff with it, you should make sure to free it yourself. That´s at least my understanding of it.
Hope that helps