memory leaks / what does this mean now

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 02:12, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   r11 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
hi there, i just did a debug like described in the manual and got quite a lot of potential memory leaks found(see below). what does this mean, what do i need to do now?
thanks for your help,
ello

> Quote: __
>
> * * *
>
> ge_container.cp, Line 1377 - > 16 Bytes at 0x0DB16444!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0DB16354!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0DBA93C4!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0DB9E924!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBC36E4!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0DBA4CD4!
> register.cpp, Line 65 -> 1000 Bytes at 0x105E25DC!
> PolygonObject.c, Line 2895 -> 288 Bytes at 0x0D06146C!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x10088C8C!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x100804EC!
> ge_smart_link.c, Line 432 -> 40 Bytes at 0x10933E4C!
> variabletag.h, Line 65 -> 96 Bytes at 0x0DA2CD84!
> variabletag.h, Line 52 -> 40 Bytes at 0x109343EC!
> ge_smart_link.c, Line 236 -> 40 Bytes at 0x10932FAC!
> Atom.cpp, Line 459 -> 32 Bytes at 0x109337EC!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x1008008C!
> register.cpp, Line 93 -> 536 Bytes at 0x106C2EAC!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x100811BC!
> ge_smart_link.c, Line 432 -> 40 Bytes at 0x109364EC!
> variabletag.h, Line 65 -> 96 Bytes at 0x0DA4EB44!
> variabletag.h, Line 52 -> 40 Bytes at 0x1093690C!
> ge_smart_link.c, Line 236 -> 40 Bytes at 0x109340EC!
> Atom.cpp, Line 459 -> 32 Bytes at 0x10935BEC!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x1008085C!
> register.cpp, Line 95 -> 536 Bytes at 0x106C2C3C!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x1008053C!
> ge_smart_link.c, Line 432 -> 40 Bytes at 0x10939B4C!
> variabletag.h, Line 65 -> 192 Bytes at 0x0CB3B9BC!
> variabletag.h, Line 52 -> 40 Bytes at 0x1093A4AC!
> ge_smart_link.c, Line 236 -> 40 Bytes at 0x109368AC!
> Atom.cpp, Line 459 -> 32 Bytes at 0x1094230C!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x10080DFC!
> register.cpp, Line 108 -> 704 Bytes at 0x105435FC!
> ge_smart_link.c, Line 236 -> 40 Bytes at 0x1093E70C!
> Atom.cpp, Line 459 -> 32 Bytes at 0x109377AC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x10080A8C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x100852BC!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x1008549C!
> register.cpp, Line 97 -> 528 Bytes at 0x106C227C!
> ge_smart_link.c, Line 236 -> 40 Bytes at 0x109398AC!
> Atom.cpp, Line 459 -> 32 Bytes at 0x109408CC!
> PolygonObject.c, Line 7798 -> 8 Bytes at 0x0DBCA664!
> pluginlayer.cpp, Line 532 -> 16 Bytes at 0x1008891C!
> register.cpp, Line 75 -> 1304 Bytes at 0x10960CFC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x1012490C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x10126D9C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x10126A7C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x1012701C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBDC124!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x10124C2C!
> register.cpp, Line 65 -> 1000 Bytes at 0x1052C5FC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x101357FC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x101356BC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x10141F0C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x1013A20C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBCD824!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x1013AF7C!
> register.cpp, Line 65 -> 1000 Bytes at 0x10375C0C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x10778F9C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x10778EAC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x10786BEC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x1077C9BC!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0D368E5C!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x1077BF1C!
> register.cpp, Line 65 -> 1000 Bytes at 0x105DA99C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60AA6C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62C39C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62C52C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D627D4C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB28A4!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D61A32C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080D0FDC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61BB8C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61C58C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62FC2C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60DC6C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB0864!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D61AEBC!
> register.cpp, Line 65 -> 1000 Bytes at 0x080C482C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61A82C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D616B3C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60B1EC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60F06C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB11E4!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D6066EC!
> register.cpp, Line 65 -> 1000 Bytes at 0x080CA9CC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D609B6C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61C5DC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62F68C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D608EEC!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB3364!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D62BE9C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080CA55C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60970C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62FB3C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61AE6C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D6097FC!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB3CE4!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D62C7FC!
> register.cpp, Line 65 -> 1000 Bytes at 0x080CAE3C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60885C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61299C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61AAFC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61B77C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB3FA4!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D61A78C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080C9C7C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61488C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61AE1C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62C3EC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62BA8C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB1364!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D6092AC!
> register.cpp, Line 65 -> 1000 Bytes at 0x080CBFFC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61AB4C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60DF8C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60943C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D617DAC!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB1724!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D60F29C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080C81DC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62ED2C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D617CBC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D609A2C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60B41C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB3464!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D608A8C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080CF9AC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61ABEC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62C61C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60BAAC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D608E9C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB3964!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D60C09C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080C31FC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60B7DC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60902C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D604D9C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62BEEC!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB4164!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D60F4CC!
> register.cpp, Line 65 -> 1000 Bytes at 0x080CEC5C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61B4AC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61BCCC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61BA4C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D6117CC!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB1FE4!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D62FE5C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080C24AC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D607EAC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62F6DC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D6099DC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D608B7C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB07A4!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D611B3C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080CF53C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60D67C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D607E0C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D616CCC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61857C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB28E4!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D60C04C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080C2D8C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62F81C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60849C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61BB3C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D611C7C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB2FE4!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D62C84C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080CE37C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60BCDC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60939C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60754C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61A41C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB3B24!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D60470C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080C1BCC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D6089EC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62C43C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D60948C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62FEFC!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB2DE4!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D62FBDC!
> register.cpp, Line 65 -> 1000 Bytes at 0x080D06FC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61226C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D61B63C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D613BBC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D604F2C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0DBB0C24!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D60894C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080C3F4C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0DB8AB04!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62789C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D6048EC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62EB9C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0D370C9C!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D6093EC!
> register.cpp, Line 65 -> 1000 Bytes at 0x080CBB8C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D6FF3D4!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D707CB4!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D6FCA94!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D703934!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0D365A1C!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D6FC044!
> register.cpp, Line 65 -> 1000 Bytes at 0x080C012C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62AD1C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62CD4C!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62B6CC!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D62B35C!
> NullObject.cpp, Line 15 -> 8 Bytes at 0x0D35851C!
> pluginlayer.cpp, Line 229 -> 16 Bytes at 0x0D62CB1C!
> register.cpp, Line 65 -> 1000 Bytes at 0x080BFCBC!
> PolygonObject.c, Line 2895 -> 288 Bytes at 0x0D060EAC!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x0D70EAB4!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x0D6E8CC4!
> ge_smart_link.c, Line 432 -> 40 Bytes at 0x0D6BC414!
> variabletag.h, Line 65 -> 96 Bytes at 0x0D42B9DC!
> variabletag.h, Line 52 -> 40 Bytes at 0x0D6BF834!
> ge_smart_link.c, Line 236 -> 40 Bytes at 0x0D6BE694!
> Atom.cpp, Line 459 -> 32 Bytes at 0x0D6BEE74!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x0D6E75F4!
> register.cpp, Line 93 -> 536 Bytes at 0x0BF79EAC!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x0D6E85E4!
> ge_smart_link.c, Line 432 -> 40 Bytes at 0x0D6BFA14!
> variabletag.h, Line 65 -> 96 Bytes at 0x0D42BA8C!
> variabletag.h, Line 52 -> 40 Bytes at 0x0D6BE514!
> ge_smart_link.c, Line 236 -> 40 Bytes at 0x0D6BEED4!
> Atom.cpp, Line 459 -> 32 Bytes at 0x0D6BE394!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x0D6EA984!
> register.cpp, Line 95 -> 536 Bytes at 0x0BF79C3C!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x0D6E7B44!
> ge_smart_link.c, Line 432 -> 40 Bytes at 0x0D6BFAD4!
> variabletag.h, Line 65 -> 192 Bytes at 0x0CB3926C!
> variabletag.h, Line 52 -> 40 Bytes at 0x0D6BE5D4!
> ge_smart_link.c, Line 236 -> 40 Bytes at 0x0D6BF8F4!
> Atom.cpp, Line 459 -> 32 Bytes at 0x0D6BE454!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x0D6E71E4!
> register.cpp, Line 108 -> 704 Bytes at 0x02B56CFC!
> ge_smart_link.c, Line 236 -> 40 Bytes at 0x0D6BE634!
> Atom.cpp, Line 459 -> 32 Bytes at 0x0D6BEF94!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D6E6D84!
> ge_container.cp, Line 1377 -> 16 Bytes at 0x0D6EC374!
> ge_smart_link.c, Line 331 -> 24 Bytes at 0x0D6EC6E4!
> register.cpp, Line 97 -> 528 Bytes at 0x0BF799CC!
> ge_smart_link.c, Line 236 -> 40 Bytes at 0x0D6BFBF4!
> Atom.cpp, Line 459 -> 32 Bytes at 0x0D6BE4B4!
> PolygonObject.c, Line 7798 -> 8 Bytes at 0x0D356ADC!
> pluginlayer.cpp, Line 532 -> 16 Bytes at 0x0D70C994!
> register.cpp, Line 75 -> 1304 Bytes at 0x02C30A2C!
> 249 Blocks
>
>
> *** Potential Memory Leak Detected ***
>
>
> * * *

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 04:17, xxxxxxxx wrote:

This means you have created several objects in your code and forgot to free them.

Every time you create something e.g. with gNew() or you allocate an object like you do with BaseObjects BaseObject::Alloc(type); you have to free them after you're done using them.
You to this either with gDelete() or the class' Free method, like BaseObject::Free(op); Which of those it is, depends on how you created the object.

The only exception are objects whose ownership is taken over by Cinema (In that case the SDK sais "CINEMA 4D takes over the ownership" or "CINEMA 4D owns the pointed object").

Leaks are generally bad, because your plugin keeps on allocating more and more memory, without freeing the unused old memory blocks. If it's only a few bytes, no matter how long the plugin was in use, that's not too bad (but should be fixed anyway). But if you notice the amount of memory leaks is different every time, or the leaks get bigger if the plugin is in use for a longer time, you're in trouble. If somebody lets your plugin run for a couple of hours, it may crash because all the RAM is stuffed with rubbish.

If you manage to close all your leaks (or *at least* the ones that get bigger while the plugin is in use), you can regard your plugin as stable ;-)

Greetings,
Jack

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 07:35, xxxxxxxx wrote:

thanks.. now i'll look what could be the cause. at least i've hunted it down to one of three objectplugins :)
cheers,
ello

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 11:00, xxxxxxxx wrote:

So you're Ello, too?
How many accounts do you have?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 11:10, xxxxxxxx wrote:

3 ;) and thats just because the password email doesnt work.. i already sent a mail to maxon but didnt got a response so far.. i'd be glad to use my original "ello" account again

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 14:22, xxxxxxxx wrote:

i found that this line is responsible:

> `

  
\>  op = (BaseObject* )(profile->GetClone(0, NULL));  
\>  

`

but using Free(op); doesnt help...

profile is created here:
> `

  
\>  BaseObject *profile = (BaseObject* )(bc- >GetLink(PROFILE,op->GetDocument()));  
\>  

`

any further hints?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 14:47, xxxxxxxx wrote:

BaseObject* profile = bc->GetObjectLink(PROFILE, op->GetDocument());
if (!profile) // do something

Always check for NULL in cases like this (the user could clear the LINK)!

What are you doing with the clone?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 15:10, xxxxxxxx wrote:

the full part already looks like this:

> `

  
\>  BaseObject *op = BaseObject::Alloc(Osplinecircle);  
\>  if (profile)   
\>  {  
\>  profile ->SetEditorMode(MODE_OFF);  
\>  profile->SetRenderMode(MODE_OFF);  
\>  op = (BaseObject* )(profile->GetClone(0, NULL));  
\>  }  
\>  profile->InsertUnderLast(sweep);  
\>  

`

if i dont uses the LINK the leaks dont appear

btw. this all happens in a for-loop

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 15:42, xxxxxxxx wrote:

You should move profile->InsertUnderLast(sweep) into the if{} block just in case profile is NULL, otherwise the code may crash.

You allocate to op instead of profile. I hope that is just a typing error here or is profile coming from someplace else?

You may need to create an AliasTrans and see if that removes the leaks from GetClone(). Normally you need one if the clone is going into another document than the one inwhich the original resides.

Finally, are you calling BaseObject::Free(op) in the for loop? Otherwise you would only be freeing the last iteration.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 21:52, xxxxxxxx wrote:

yes, that was a typo. its "op" which is inserted..

i'll check that with the AliasTrans.. the manual sayi it can be NULL.. but i'll see what the manual offers about that..

I used the Free(op); inside the loop but that doesnt help

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/05/2009 at 22:12, xxxxxxxx wrote:

Okay. :)

AliasTrans can be NULL, but in the case of cloning into other documents it should not. The reason is that AliasTrans does the 'reassigning' in such cases (such as when the object has a link which isn't cloned and doesn't exist in the new document, it will clear it accordingly, and so on).

Still, I'm not sure if the GetClone() is the only cause of the leaks. Is it definitive or circumstantial?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/05/2009 at 02:48, xxxxxxxx wrote:

just to clarify, i am not cloning it into another document.

the leaking appears as soon as i use this line:
op = (BaseObject* )(profile->GetClone(0, NULL));

when i comment it out, everything is fine :)

btw. it only happens when i have dragged something into the link field and the condition "if(profile)" is true

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/05/2009 at 04:45, xxxxxxxx wrote:

definately has something to do with the combination of cloning the linked object since using a child object (op->GetDown(); does work with this line:

> `

  
\>  BaseObject *clone = static_cast<BaseObject*>(child->GetClone(0, NULL));  
\>  

`

any ideas?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/05/2009 at 08:35, xxxxxxxx wrote:

Instead of:
BaseObject *op = BaseObject::Alloc(Osplinecircle);

do:
Baseobject* op = NULL;

You don´t need to allocate op if you fill it with a clone later on. C4D does the memory allocation for the clone internally when you call GetClone().

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/05/2009 at 08:42, xxxxxxxx wrote:

thanks! that was my idea to have at least a splinecircle when the user didnt drag a spline to the link field.

but just a second ago i found out that somehow exactly that creation of the circle beforehand was the issue. now there is no leaking and i am just feeling lighter now :D

thanks for all your help here!

this is how i do it now:

> `

  
\>    
\>                 if(profileLink)       
\>                 {  
\>                      BaseObject *profile = static_cast<BaseObject*>(profileLink->GetClone(0, NULL));  
\>                      profile->InsertUnderLast(sweep);  
\>                 }  
\>  

`