wails icon indicating copy to clipboard operation
wails copied to clipboard

crash with two save file dialog call

Open lilili87222 opened this issue 1 year ago • 11 comments

Description

path, e3 := runtime.SaveFileDialog(a.ctx, runtime.SaveDialogOptions{DefaultFilename: fname, Title: "Save file", CanCreateDirectories: true}) path2, e4 := runtime.SaveFileDialog(a.ctx, runtime.SaveDialogOptions{DefaultFilename: fname, Title: "Save file", CanCreateDirectories: true})

two save file dialog call, then click cancel , crashed ,showing the follow error.

2023/05/03 15:15:29 The parameter is incorrect. [0503/151529.490:ERROR:window_impl.cc(119)] Failed to unregister class Chrome_WidgetWin_0. Error = 0

To Reproduce

crashed with two save file dialog call

Expected behaviour

cancel and back to application window. but it crashed.

Screenshots

No response

Attempted Fixes

No response

System Details

wails 2.41

	Windows 10 	19045.2846
	Windows Feature Experience Pack 120.2212.4190.0

Additional context

No response

lilili87222 avatar May 03 '23 07:05 lilili87222

Thanks for using Wails and reporting this issue.

Could you please try the latest master version, there has been a fix for those dialogs. See PR #2606

stffabi avatar May 03 '23 07:05 stffabi

Could you please also specify what the content of fname is?

stffabi avatar May 03 '23 07:05 stffabi

ok,I will try the latest master version

lilili87222 avatar May 03 '23 09:05 lilili87222

I change to version,and the same ,fname is "abc.p12" v2.4.2-0.20230501125710-516c4853f91e

lilili87222 avatar May 03 '23 09:05 lilili87222

You're opening 2 save file dialogs after each other. Presumably fname isn't the same value for both?

leaanthony avatar May 03 '23 20:05 leaanthony

the same value for fname.

lilili87222 avatar May 04 '23 01:05 lilili87222

function SaveFile(){ time.Sleep(time.Second) runtime.SaveFileDialog(a.ctx, runtime.SaveDialogOptions{DefaultFilename: "hello.txt", Title: "Save file", CanCreateDirectories: true}) }

call SaveFile() from js when click save button. click save button twice fast . click cancel when two save file dialog displayed.

lilili87222 avatar May 04 '23 01:05 lilili87222

Awesome, thanks I was able to reproduce it with your latest comment 👍

stffabi avatar May 04 '23 05:05 stffabi

That is great.Thanks for this great project.

lilili87222 avatar May 05 '23 01:05 lilili87222

@lilili87222 - is this still an issue?

leaanthony avatar Oct 25 '23 08:10 leaanthony

I experience "The parameter is incorrect." but haven't figured out how to recreate yet. @leaanthony

Humphryyy avatar Oct 25 '23 15:10 Humphryyy