BUG-v621 WebViewGadget example code crashes on Windows 11

Post bugreports for the Windows version here
User avatar
skywalk
Addict
Addict
Posts: 4210
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

BUG-v621 WebViewGadget example code crashes on Windows 11

Post by skywalk »

Windows 11 v24H2, all compiler options, crash after clicking button.
EDIT: Crashes with DEBUGGER ON. OK with DEBUGGER OFF.

Code: Select all

Procedure IncrementCallback(JsonParameters$)
  Static Count
  Debug #PB_Compiler_Procedure +": " + JsonParameters$
  Count + 1
  ProcedureReturn UTF8(~"{ \"count\": "+Str(Count)+ "}")
EndProcedure

Procedure ComputeCallback(JsonParameters$)
  Debug #PB_Compiler_Procedure +": " + JsonParameters$
  Dim Parameters(0)
  ; Extract the parameters from the JSON
  ParseJSON(0, JsonParameters$)
  ExtractJSONArray(JSONValue(0), Parameters())
  Debug "Parameter 1: " + Parameters(0)
  Debug "Parameter 2: " + Parameters(1)
  ProcedureReturn UTF8(Str(Parameters(0) + Parameters(1))) ;<-- CRASH WITH DEBUGGER
EndProcedure

OpenWindow(0, 100, 100, 400, 400, "Hello", #PB_Window_SystemMenu | #PB_Window_Invisible)
WebViewGadget(0, 0, 0, 400, 400)
SetGadgetText(0, "file://" + #PB_Compiler_Home + "examples/sources/Data/WebView/webview.html")
BindWebViewCallback(0, "increment", @IncrementCallback())
BindWebViewCallback(0, "compute", @ComputeCallback())
; Show the window once the webview has been fully loaded
HideWindow(0, #False)
Repeat 
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Last edited by skywalk on Sun Jun 22, 2025 3:37 pm, edited 6 times in total.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
mk-soft
Always Here
Always Here
Posts: 6201
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: [BUG-v621b2] WebViewGadget example code crashes on Windows 11

Post by mk-soft »

Windows 10 Pro works
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Quin
Addict
Addict
Posts: 1122
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: [BUG-v621b2] WebViewGadget example code crashes on Windows 11

Post by Quin »

As does Windows 10 IoT LTSC, 21H2.
Windows 11 24H2 does not.
User avatar
CDXbow
User
User
Posts: 97
Joined: Mon Aug 12, 2019 5:32 am
Location: Oz

Re: [BUG-v621b2] WebViewGadget example code crashes on Windows 11

Post by CDXbow »

Works OK on my laptop and desktop, both 64bit Win11 Pro version 22H2
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Done] BUG-v621b2 WebViewGadget example code crashes on Windows 11

Post by Fred »

I updated the webview component to lastest version, could you try with the next beta ?
User avatar
skywalk
Addict
Addict
Posts: 4210
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Done] BUG-v621b2 WebViewGadget example code crashes on Windows 11

Post by skywalk »

Hi, code is OK with DEBUGGER OFF, but still crashes below with DEBUGGER ON.

Code: Select all

Procedure IncrementCallback(JsonParameters$)
  Static Count
  Debug #PB_Compiler_Procedure +": " + JsonParameters$
  Count + 1
  ProcedureReturn UTF8(~"{ \"count\": "+Str(Count)+ "}")
EndProcedure

Procedure ComputeCallback(JsonParameters$)
  Debug #PB_Compiler_Procedure +": " + JsonParameters$
  Dim Parameters(0)
  ; Extract the parameters from the JSON
  ParseJSON(0, JsonParameters$)
  ExtractJSONArray(JSONValue(0), Parameters())
  Debug "Parameter 1: " + Parameters(0)
  Debug "Parameter 2: " + Parameters(1)
  ProcedureReturn UTF8(Str(Parameters(0) + Parameters(1))) ;<-- CRASH WITH DEBUGGER
EndProcedure

OpenWindow(0, 100, 100, 400, 400, "Hello", #PB_Window_SystemMenu | #PB_Window_Invisible)
WebViewGadget(0, 0, 0, 400, 400)
SetGadgetText(0, "file://" + #PB_Compiler_Home + "examples/sources/Data/WebView/webview.html")
BindWebViewCallback(0, "increment", @IncrementCallback())
BindWebViewCallback(0, "compute", @ComputeCallback())
; Show the window once the webview has been fully loaded
HideWindow(0, #False)
Repeat 
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Little John
Addict
Addict
Posts: 4773
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: [Done] BUG-v621b2 WebViewGadget example code crashes on Windows 11

Post by Little John »

skywalk wrote: Mon Apr 14, 2025 7:20 pm Hi, code is OK with DEBUGGER OFF, but still crashes below with DEBUGGER ON.
Confirmed with PB 6.21 beta 5 (x64) on Windows 11 Pro.
Little John
Addict
Addict
Posts: 4773
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: [Done] BUG-v621b2 WebViewGadget example code crashes on Windows 11

Post by Little John »

Little John wrote: Mon Apr 14, 2025 9:02 pm
skywalk wrote: Mon Apr 14, 2025 7:20 pm Hi, code is OK with DEBUGGER OFF, but still crashes below with DEBUGGER ON.
Confirmed with PB 6.21 beta 5 (x64) on Windows 11 Pro.
Still the same problem here with beta 6.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: BUG-v621b8 WebViewGadget example code crashes on Windows 11

Post by Marco2007 »

6.21 final -> no crash here:
Windows 11 Pro 64 bit, 24H2 - 26100.4349
PureBasic for Windows
User avatar
skywalk
Addict
Addict
Posts: 4210
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: BUG-v621 WebViewGadget example code crashes on Windows 11

Post by skywalk »

V621 still crashes with DEBUGGER ON.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply