wailsapp / wailsapp/wails

Improve go-webview2 com object release

Open
#3,931 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement MacOS P1 v3 Windows
Dominant language
Go
Stars
36.3k
Forks
1.9k
Avg merge
2d 11h
Merged PRs (30d)
33

Description

This is a followup from https://github.com/wailsapp/go-webview2/pull/25#issuecomment-2513894748 which couldn't be fixed properly as wails build fails in Windows if it were changed.

The cause of the build failure is due to these codes that expects error return from Release function which only returns reference count as a uint32 value, not an error, which can cause unexpected erroring as Proc.Call states that

The returned error is always non-nil, constructed from the result of GetLastError. Callers must inspect the primary return value to decide whether an error occurred (according to the semantics of the specific function being called) before consulting the error. The error always has type Errno.

These parts expect Release to return an error which prevent building from succeeding.

If this were to be fixed, wails and go-webview2 would need to be fixed at the same time(as wails depends on go-webview2).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/assetserver/webview/request_windows.go at the three linked ranges and review how Release and syscall.Proc.Call are handled. Then inspect the corresponding go-webview2 implementation, since both projects must change together. Done means the Release return value is handled according to the Windows API and wails build succeeds on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.