altv-issues
altv-issues copied to clipboard
Creating multiple WebView on same texture crashes the client
Description of the problem
WebView.isVisible have no effect at all for WebView that is mounted on texture. Creating WebView on texture and then by creating another WebView on same texture you can see that it works as expected you see document from the second WebView. Destroying one WebView texture sometimes glitches in various colors and it won't show another WebView that is created already. Destroying both WebView instantly crashes the client. (it still crashes if you destroy first webview and after some time second webview).
Reproduction steps
(async() => {
// load model
if(!native.hasModelLoaded(alt.hash('v_ilev_cin_screen'))) {
await alt.Utils.requestModel(alt.hash('v_ilev_cin_screen'));
}
// create object
const object = native.createObjectNoOffset(alt.hash('v_ilev_cin_screen'), 181.3, 6417.93, 36.3, false, false, false);
native.freezeEntityPosition(object, true);
native.setEntityRotation(object, 0, 0, 244.7, 0, false);
native.setEntityLodDist(object, 150);
setTimeout(() => {
console.log('create first webview');
const webview_1 = new alt.WebView('about:blank', alt.hash('v_ilev_cin_screen'), 'script_rt_cinscreen');
setTimeout(() => {
console.log('create second webview')
const webview_2 = new alt.WebView('about:blank', alt.hash('v_ilev_cin_screen'), 'script_rt_cinscreen');
setTimeout(() =>{
console.log('destroy first webview')
webview_1.destroy();
console.log('destroy second webview')
webview_2.destroy();
}, 1500)
}, 1500)
}, 5000)
})();
Expected behaviour
WebView.isVisible = false should detach WebView from the texture and hide actual document.
WebView.isVisible = true should reatach WebView to texture that been entered on WebView creation. (if WebView already exists on that texture it should make that WebView,isVisible = false (detach and hide).
Additional context
-crash 310156211406503937 150610642 "2f6dc2ede55b6525a9042d0069c8e7243cf13ed6214f8fb888726fc090c3b5a7" 7911980094128979590 3028 "dev" "15.0-dev944" 140717204431859 "D:\altv\crashdumps\crashdump.dmp" "D:\altv\logs\client_2023-12-10_17-06-13.log" 4 84951 "127.0.0.1:7785" "none" "15.0-dev944" -noupdate
[1210/170738.000:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = about:blank, status = 4, exit_code = 258 [1210/170738.004:INFO:render_frame_host_impl.cc(11505)] RenderFrameHostImpl::MaybeGenerateCrashReport url = about:blank, status = 4, exit_code = 258
(next few frames of the gif is desktop)
Operating system
Windows 11
Version
15.0-dev944, 15.62 release
Crashdump ID
-crash 310156211406503937 150610642 "2f6dc2ede55b6525a9042d0069c8e7243cf13ed6214f8fb888726fc090c3b5a7" 7911980094128979590 3028 "dev" "15.0-dev944" 140717204431859 "D:\altv\crashdumps\crashdump.dmp" "D:\altv\logs\client_2023-12-10_17-06-13.log" 4 84951 "127.0.0.1:7785" "none" "15.0-dev944" -noupdate
Confirmation of issue's presence
- [X] By submitting this ticket, I affirm that I have verified the presence of this issue on the latest developer version available at the time of writing this ticket.
Without destroying WebView using code but using reconnect command it crashes client too. That's because client destroys WebViews itself.