multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.42k stars 437 forks source link

guiCreateBrowser Issue #3786

Open Jihedbrahim opened 1 month ago

Jihedbrahim commented 1 month ago

Describe the bug

each time i try to destroy the browser my game crashes and even that happened not only to me. https://forum.multitheftauto.com/topic/144578-need-help-on-executebrowserjavascript/#comment-1029546

Steps to reproduce

open browser close the browser my game crashes

Version

No response

Additional context

No response

Relevant log output

No response

Security Policy

Lpsd commented 1 month ago

When submitting an issue, please provide as much detail as possible.

Ideally, you still need to confirm the following:

Also, do you receive a crash dialog?

Lpsd commented 1 month ago

From a quick test (custom build of latest master 4e18928) it appears that creating a GUI browser and deleting the browser element (not the GUI element) can cause instability and crash-to-desktop (no dialog). e.g:

browserGUI = guiCreateBrowser(0, 0, width, height, false, false)
browser = guiGetBrowser(browserGUI)

destroyElement(browser)

Instead, you should destroyElement(browserGUI) to avoid crashes. This should be fixed in MTA however.

Jihedbrahim commented 1 month ago

this is how i done on my script : https://forum.multitheftauto.com/topic/144578-need-help-on-executebrowserjavascript/#comment-1029546 and here i have already reported it : https://forum.multitheftauto.com/topic/144614-mta-crashes/ i get different module each time as i remember i got d3d9.dll and cgui.dll

Jihedbrahim commented 1 month ago

MTA client version : 1.6.0-9.22746.0

Lpsd commented 1 month ago

Have you tested the suggestion?

Jihedbrahim commented 1 month ago

oh yea, i have done that and works, i didnt see that i was destroying the wrong one, i was destroying guiGetBrowser(browserGUI)