Fix leaking wxFSFile in GTK WebKit (PR #26802)

11 views
Skip to first unread message

Blake-Madden

unread,
Aug 8, 2026, 9:59:31 AM (2 days ago) Aug 8
to wx-...@googlegroups.com, Subscribed

Also, document wxWebViewHandler::GetFile() ownership.

The file returned from wxWebViewHandler::GetFile() wasn't being deleted in the GTK WebKit backends.

Please let me know if I am not correct, but from my research:

For IE (src\msw\webview_ie.cpp), the returned file from GetFile() gets this upon read completion: wxDELETE(m_file);

For Edge, GetFile()'s return is wrapped in a wxWebViewHandlerResponseDataFile, which deletes the file in its DTOR.

In the base implementation (src/common/webview.cpp), wxWebViewHandlerResponseDataFile does the same thing of deleting the file from GetFile() in its DTOR.

Finally, it appears that all wxFileSystemHandler::OpenFile()s return new wxFSFile (which GetFile() calls), so this seems to confirm this expected ownership contract (that GTK WebKit is currently not following).


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26802

Commit Summary

  • b041c2e Fix leaking wxFSFile ni GTK WebKit
  • c013372 Document wxWebViewHandler::GetFile() ownership contract

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26802@github.com>

VZ

unread,
Aug 9, 2026, 12:38:17 PM (14 hours ago) Aug 9
to wx-...@googlegroups.com, Subscribed

@vadz approved this pull request.

Thanks, looking at the common code this indeed looks correct to me.

But there might be also a leak in VirtualProtocol used in src/msw/webview_ie.cpp as it doesn't seem to delete the object when being destroyed normally, i.e. without an error. Of course, nobody probably uses IE-based webview anyhow by now.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26802/review/4891890509@github.com>

VZ

unread,
Aug 9, 2026, 1:37:16 PM (13 hours ago) Aug 9
to wx-...@googlegroups.com, Subscribed

Merged #26802 into master.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26802/issue_event/29188510101@github.com>

Reply all
Reply to author
Forward
0 new messages