Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-05-2010, 07:09 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Access violations while trying to destroy() a GuiShowImgCtrl

So I'm trying to develop a system that gives you a visual of what buffs you currently have on you. Using a for loop to update itself. I'm still perfecting this, and was trying to see what would happen if I tried destroying the GuiShowImgCtrls each loop before generating new ones. So I added the following line to test destroying the first one on the list:
PHP Code:
Test_ShowImg_1.destroy(); 
Now when I do this, and hit apply, we get a few Access Violations.
the first one states:
Access violation at address 0B043FA2. Read of address FFFFFFFF.

When we close it, we get a new one:
Access violation at address 021F9DD9. Write of address E6BF87E2.

Next one in the order is:
Access violation at address 021F9DD0. Read of address 800B32BD.

Next is:
Access violation at address 021F9DDE. Write of address 00000004.

And finally:
Access violation at address 0B0DBAB8. Write of address 000001FA.

Every following access violation is a repeat of the last one I've listed. Until of course, you remove the line and put it there again.
Just thought I'd share assuming this won't already be fixed/prevented in the next version.



Edit: okay weird thing happened

First of all, this worked the first time i tried it without any errors. then when i started getting them, after taking out that line of code and putting it back in a few times, I eventually got another access violation (the last one) and it disconnected me. When I reconnected, there were no access violations, and the number of images representing the buffs on my screen went from 5 to 1. (the first time i tried this, it removed all of the images).

When I removed the line of code again, it went from 1 image to 4. (4 is what its supposed to be displaying)

Putting the line of code in again results in:
Access violation at address 01020318. Write of address 00000000.
Access violation at address 2C302C30. Read of address 2C302C30.
Each following is a repeat of the second.

removing then adding it results in:
Access violation at adress 0A8EFE4B. Write of address 00000054.
Access violation at address 0A8EFE4F. Read of address 50014D06. (repeatedly)

And I'm gonna stop logging these now. They seem like they might be either randomized or part of a giant list
__________________
MY POSTS ARE PRONE TO EDITS!

Last edited by Jiroxys7; 08-05-2010 at 07:26 PM..
Reply With Quote
  #2  
Old 08-05-2010, 07:31 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
There were some issues with destroying GUI controls before creating them I believe. Jerret will probably reply soon and clear things up
Reply With Quote
  #3  
Old 08-05-2010, 07:38 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
It is fixed in v6. I don't know any way to workaround it as I've never really encountered it.
__________________
Reply With Quote
  #4  
Old 08-05-2010, 07:42 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by Crow View Post
There were some issues with destroying GUI controls before creating them I believe. Jerret will probably reply soon and clear things up
Weird thing is, suddenly it's inconsistent. It stopped giving me access violation errors a moment ago and the system was working perfectly by destroying the guis before the loop telling it to create them. Then when I decided to run this in a for loop so i could automatically append the GUI names, it stopped working. still no errors though. When i went back to put the destroy(); codes back in, it still didnt work. yet still no errors. So i decided i should try to see if the errors popped up if i put the destroys after the for loop (which is after the guis have been created). and no error messages this time.

though my script now still isnt working. Weird..
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #5  
Old 08-05-2010, 08:03 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Are you checking if the GUI control exists before destroying it?
Reply With Quote
  #6  
Old 08-05-2010, 08:21 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by Crow View Post
Are you checking if the GUI control exists before destroying it?
Yeah I just got it working =P
It didnt work like i thought it would though. Basically every time a gui is created, it adds +1 to a variable. but BEFORE all of that, it used to check if the variable was greater than 1, then delete a gui. like if the variable came back as 5, it would delete the first 5 guis. and then after that for loop, it would set the value to 0 and continue.

weird thing is, it didnt work unless i changed the "> 0" to "== 0". so basically seeing if that variable equals zero. even though it's returning a greater value.

i also ran into a weird problem. sometimes variables dont work if theyre temp.variablename and will only work if theyre this.variablename (yes theyre in the same function. and renaming the name of the variable doesnt change the outcome)

yet in this case, my variable was named this.iconnumbers but it wouldnt work until i changed it to temp.iconnumbers
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #7  
Old 08-06-2010, 12:04 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
If you destroy and create a GUI in the same function callstack, exceptions occur not every time but eventually they do.

Work-around:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  if (
isObject("awesomeGUI")) {
    
awesomeGUI.destroy();
  }
  
this.scheduleevent(0.05"CreateGUI"""); // Should be able to use trigger as well, but the difference would be neglible.
}

function 
onCreateGUI() {
  new 
GuiWindowCtrl("awesomeGUI") {
    
10;
    
width height 100;
  }

As for your "this." variable situation, you were probably accessing it at the wrong level of scope.

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.value 5;
  new 
GuiButtonCtrl(testButton) {
    
width height 100;
    
= (screenwidth width) / 2;
    
= (screenheight height) / 2;
    
this.other "lol";
    
text "Value: " thiso.value// Would show Value: 5
    
text "Other: " this.other// Would show Other: lol
  
}

__________________
Quote:
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.