Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] @TGC Plugins, String Pointers, Garbage Collection

Author
Message
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 25th Jul 2021 18:24
When returning a string pointer from a plugin function does AppGameKit destroy the pointer?

Strings created with CreateString must be deleted with DeleteString, but when returning a string pointer from my function I no longer have access to the pointer to destroy it because the function has returned, I globalised it and checked the pointer and it appears to have been cleared but could you please confirm what AppGameKit does with this buffer?

I'm getting random IMA's and am trying to track the cause and its looking like strings at this stage, I'v a bulk of function calls to a XML plugin (project loading routine) and its crashing out somewhere in the middle of these calls, a lot of string data is changing hands so it must be something in there.

The author of this post has marked a post as an answer.

Go to answer

adambiser
AGK Developer
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 25th Jul 2021 18:52
This post has been marked by the post author as the answer.
From AGKCommonSwitch.h in Tier 2\apps\interpreter:


PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 25th Jul 2021 19:39

Login to post a reply

Server time is: 2024-04-26 17:08:15
Your offset time is: 2024-04-26 17:08:15