Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 712 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Memory leak in ent_clone ? #479027
02/06/20 12:55
02/06/20 12:55
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hi!
Code
void main()
{
	level_load("");
	ENTITY *test_ent = ent_create(CUBE_MDL, nullvector, NULL);
	ent_clone(test_ent);
	ent_morph(test_ent, SPHERE_MDL);
}

and acklog.txt
Quote
acknet.dll opened
ackoal.dll opened
ackphysX.dll opened
Compiling TEST.C - [Esc] to abort.......... 0.085 sec
Running TEST.C.
2 objects
Main started at 1.165
D3D_Init Window: 720x480 -> Window: 1x720x480x32
Video memory found: 4093 MB
LevelInit at 1.223 0 lmaps 0 textures...ok
LevelReady at 1.224
def_startup started
Main loop at 1.232....
1st frame with 4093 MB. at 1.235
Normal exit at 1.682
Close level,DLL,objects
Free input,funcs,panels,defs,syns,views,strings,vars..ok
Free sounds,bmaps,fonts,hash,defs1,script..ok
Close dx,multimedia,D3D,engine,nexus..ok
A8 Engine - Pro Edition V8.47.1 - Mar 9 2016
(c) Conitec - www.3dgamestudio.com
Registered to: Magomet Kochkarov
Unfreed: 1078, CLO, 288 bytes
Unfreed: 1079, CLO, 476 bytes
Close window at 1.695

Am I the only one getting this memory leak?

Edit: new level_load doesn't help.. removing entity and level_load doesn't help...
Edit2: ent_cloneskin seems to be fine, only ent_clone is causing memory leaks

Best regards!

Last edited by 3run; 02/06/20 13:31.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Memory leak in ent_clone ? [Re: 3run] #479028
02/06/20 16:51
02/06/20 16:51
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi 3run,
I am afraid you missed the following manual entry in 'ent_clone'

Quote
A cloned entity must not be cloned a second time or ent_morphed, otherwise its cloned mesh and skin are 'orphaned' and not released from memory.


Salud!

Re: Memory leak in ent_clone ? [Re: 3run] #479029
02/06/20 17:51
02/06/20 17:51
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Ohh.. I missed that one indeed grin Thank you for pointing this out man! You are always helpful! laugh

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1