Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


What type of actions may throw this

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Sun Jul 27, 2014 3:53 am    Post subject: What type of actions may throw this Reply with quote

Hello,
Today I faced an error saying "Privileged instruction" when shutting down.
I've changed the way of a trainer work (instead of destroying objects and recreating, just hide and display based on the page), and when shutting down I got that error.

Anything that might throw that kind of error?

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25839
Location: The netherlands

PostPosted: Sun Jul 27, 2014 4:33 am    Post subject: Reply with quote

Perhaps you destroyed an object and referenced it afterwards?
E.g. createForm() creates a form that has it's onClose event set to free on close. So if ce closes and the form has been closed by ce, the form (and all it's components) will point to invalid memory locations

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Sun Jul 27, 2014 5:05 am    Post subject: Reply with quote

Well my on close function is this
Code:
form.onClose = function (sender) sender.hide();  GLOBAL.OBJECTS.CURRENT_PAGE = 0; stop_render = true; can_update = false; thread_waitfor(thread); sleep (100); closeCE(); end;

current_page --> most pages are checking if the current page is equals to the needed page (so that prevents updates there)
stop_render --> inside of a creatNativeThread function, where it renders stuff on a bitmap so to avoid it from it to render on a object.
can_update --> breaks the loop (while true do .. end)
thread_waitfor(thread) --> waiting for the a local variable thread (which contains thread), the thread was set to not free on terminate;
sleeping 0.1 sec
closingCE()

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites