Comments (4)
Please try debugging the leak using the same tool you used to detect it in the first place to see where is it coming from.
Also, it's not clear which wxWebView backend you're using: is it the default (and deprecated) IE one or the Edge one (which needs to be explicitly enabled)?
from wxwidgets.
I can reproduce it with GIT master and wxWebViewIE
backend (Internet Explorer 9.11.19041), only when displaying a PDF.
Detected memory leaks!
Dumping objects ->
{51989} normal block at 0x000002398A1B0DA0, 48 bytes long.
Data: < =ll > 80 3D 6C 6C FB 7F 00 00 01 00 00 00 01 00 00 00
Object dump complete.
Adding (and verifying afterwards the allocation order number was still the same)
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
_CrtSetBreakAlloc(51989);
to WebApp::OnInit()
points to creating wxActiveXEvents
instance events
here
wxWidgets/src/msw/ole/activex.cpp
Lines 991 to 1003 in 72d5cf6
events
is never deleted, only its interface released. Of course, simply adding delete events
leads to a crash. The same code gets executed when a web page is loaded and there is no leak. So maybe the location is wrong? I have forgotten the little I ever learned about COM, but IIRC the usual pattern was the interface instance deleting itself when its reference count drops to 0: Perhaps for PDFs the interface is not released somewhere properly...
Calling wxWebViewIE::MSWSetEmulationLevel()
did not help with the leak.
from wxwidgets.
I have tried to exclude this block...
if ( cp )
{
/*
wxActiveXEvents * const
events = new wxActiveXEvents(this, ta2->guid);
hret = cp->Advise(events, &adviseCookie);
// We don't need this object any more and cp will keep a
// reference to it if it needs it, i.e. if Advise()
// succeeded.
events->Release();
CHECK_HR(hret);
*/
}
Build new library and link my app.
And see: with PDF (i use only PDF) the was no memory leak any more...
Regards
Robert
from wxwidgets.
Thanks for debugging this!
AFAICS it really looks like the connection point forgets to call Release()
on our objects, but I don't know what to do about it. Removing this code means that no wxEVT_ACTIVEX
events will be generated, which doesn't seem ideal, but, in a pinch, we probably could add some flag to disable the events generation if they're not needed anyhow and this would avoid the leak too.
I'd recommend switching to Edge backend in any case.
from wxwidgets.
Related Issues (20)
- most samples build failed in universal build: mnemonics.cpp and notifmsg had not been compiled HOT 4
- Creating a non-modal window from wxHtmlHelpController HOT 3
- [macOS] widgets sample crashes immediately HOT 2
- [macOS?] Sizers are not setting the size of windows correctly HOT 2
- [macOS] Alignment of a slider's current value looks strange HOT 1
- [macOS] Ugly drawing of slider's ticks HOT 4
- Calendar reports invalid date format when using ca_ES locale HOT 4
- [macOS] Wrong calculation of slider's vertical label positions (in case of a horizontal slider)
- [macOS] Slider value and value label do not match
- [regex] wxRegex::Compile will always popup a message box if the pattern was not valid HOT 1
- Documentation typo - wxListColumnFormat HOT 8
- wxGridBagSizer item clipping when vgap/hgap are different and some items span multiple rows/cols HOT 3
- regression: 3.2.5 kicad/gtk plot window is not shown correct. HOT 16
- `wxDialog` ignores the specified position with GTK3 HOT 4
- Memory leak in wxSearchCtrl with autocomplete HOT 8
- [macOS] wxRichTextCtrl doesn't position and show candidate of IME correctly on macOS HOT 2
- wxBitmapComboBox flickers on Windows. HOT 2
- wxGrid should disable ime input on read-only cells HOT 8
- Unpredictable crash when assigning a toolbar to a frame on macOS 14 (Sonoma) HOT 8
- wxBitmapComboBox bitmaps are rendered at x4 size at x2 window scaling on wxGTK HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wxwidgets.