Re: User32 And GDI32 Wrapper Feedback
- Posted by mattlewis (admin) Jul 20, 2012
- 1395 views
ghaberek said...
You could also pre-allocate your strings as constant pointers and let Euphoria clean them up when it's done, although I can't see a direct advantage to this one way or the other (unless you're using a lot of strings on a really really slow machine).
constant helpText = allocate_string( "This is my help text", 1 ) newt:Init(1) newt:PushHelpLine( helpText ) newt:WaitForKey() newt:Finished() -- helpText will be freed automatically when we're done
Adding the parameter to set the pointers to auto-cleanup won't actually do anything in this case. Those constants don't get dereferenced at the end. They're simply released when all of your program's memory goes away. For a time, we tried dereferencing everything when a program exited, but it caused problems.
Matt