![]() |
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:
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 :p 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 :p |
There were some issues with destroying GUI controls before creating them I believe. Jerret will probably reply soon and clear things up :p
|
It is fixed in v6. I don't know any way to workaround it as I've never really encountered it.
|
Quote:
though my script now still isnt working. Weird.. |
Are you checking if the GUI control exists before destroying it?
|
Quote:
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 |
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:
PHP Code:
|
| All times are GMT +2. The time now is 07:05 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.