Guaranteed Malloc and Free?

Non-platform specific questions.

Guaranteed Malloc and Free?

Postby Cleve Blakemore » Thu May 22, 2008 1:49 pm

If we wanted to absolutely guarantee that one function was executed before a game started to initialize something and also that another routine was called before exiting, where would we put calls to these two routines?

I wanted to load binary files of structures at game start into dynamically allocated buffers, then make certain those buffers are freed upon exiting.

Would view.CreateActor and view.DestroyActor be good places to call these routines?

I thought I heard about a main() and exit() function one time on the forums but I cannot find the thread.
Cross Platform executable generation in a 4GL C-Scripted Compiler? I've got your Game Maker hanging right here.
Cleve Blakemore
 
Posts: 26
Joined: Wed Feb 16, 2005 2:42 am
Score: 1 Give a positive score

Re: Guaranteed Malloc and Free?

Postby makslane » Thu May 22, 2008 4:50 pm

The 'Create Actor' and 'Destroy Actor' events of the view are the right place
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron