Search found 172 matches

by Virchanza
Sun May 28, 2023 3:26 pm
Forum: Platform Related Issues
Topic: Memory leaks from libfontconfig
Replies: 17
Views: 6478

Re: Memory leaks from libfontconfig

I duunno why but the Gnome guys deleted my issue and blocked my account. I emailed them to clarify.
by Virchanza
Sun May 28, 2023 2:23 pm
Forum: Platform Related Issues
Topic: Memory leaks from libfontconfig
Replies: 17
Views: 6478

Re: Memory leaks from libfontconfig

I've created an 'issue' on the GitLab for libpango:

https://gitlab.gnome.org/GNOME/pango/-/issues/750
by Virchanza
Sun May 28, 2023 2:10 pm
Forum: Platform Related Issues
Topic: Memory leaks from libfontconfig
Replies: 17
Views: 6478

Re: Memory leaks from libfontconfig

Just now I built the library 'libpango' with the compiler flag '-ggdb3', and so I get a bit more detail when the program ends: ==12305==ERROR: LeakSanitizer: detected memory leaks Direct leak of 82688 byte(s) in 323 object(s) allocated from: #0 0x7f2f988bf90f in __interceptor_malloc ../../../../src/...
by Virchanza
Sun May 28, 2023 1:35 pm
Forum: Platform Related Issues
Topic: Memory leaks from libfontconfig
Replies: 17
Views: 6478

Re: Memory leaks from libfontconfig

If you claim to have found a bug in either libfontconfig or wxWidgets, both of them will ask you to create a minimal compilable sample that shows the issue. Otherwise they'll just assume the error is somewhere in your code. Okay I've built samples/treectrl. When I run it and then close it down prop...
by Virchanza
Sun May 28, 2023 1:03 pm
Forum: C++ Development
Topic: Prevent re-entry but do not discard the event
Replies: 15
Views: 854

Re: Prevent re-entry but do not discard the event

Hi, Not sure what you mean - message loop is single threaded independently of whether it's a dialog loop or the application one. Thank you. Imagine the following scenario. There are two threads in a program. The first thread is the GUI thread. The second thread is a worker thread. Every 200 millise...
by Virchanza
Sun May 28, 2023 6:44 am
Forum: Platform Related Issues
Topic: Memory leaks from libfontconfig
Replies: 17
Views: 6478

Re: Memory leaks from libfontconfig

I have posted to the mailing list for libfontconfig to ask them:

https://marc.info/?l=freedesktop-fontco ... 214749&w=2
by Virchanza
Sun May 28, 2023 6:06 am
Forum: C++ Development
Topic: Prevent re-entry but do not discard the event
Replies: 15
Views: 854

Re: Prevent re-entry but do not discard the event

ONEEYEMAN wrote: Sun May 28, 2023 12:52 am And as doublemax explained - there is only wxYield() re-entrancy. GUI event loop is single threaded.
Also wxDialog::ShowModal.
by Virchanza
Sat May 27, 2023 10:53 pm
Forum: Platform Related Issues
Topic: Memory leaks from libfontconfig
Replies: 17
Views: 6478

Re: Memory leaks from libfontconfig

I haven't tried the samples yet. I build libfontconfig just now with "-ggdb3", and so now when my program ends I get filenames and line numbers for the leaks. It's late here in Ireland and I'm running a half-marathon tomorrow so I'll packing this in for now. Direct leak of 82688 byte(s) in...
by Virchanza
Sat May 27, 2023 10:39 pm
Forum: Platform Related Issues
Topic: Memory leaks from libfontconfig
Replies: 17
Views: 6478

Memory leaks from libfontconfig

There are two kinds of memory leaks: ( Type A ) Accumulative memory leaks. These are the bad kind. If your program runs for for 9 days, and if it allocates 2 megabytes every hour, then after 9 days you're up to 432 megabytes. ( Type B ) Once-off memory allocations that never get de-allocated. These ...
by Virchanza
Sat May 27, 2023 9:48 pm
Forum: C++ Development
Topic: Prevent re-entry but do not discard the event
Replies: 15
Views: 854

Re: Prevent re-entry but do not discard the event

I wonder if it would have been simpler to use "IsYielding()" instead of an atomic_flag? The only thing though is that I want to prevent all re-entry, not just the re-entry caused by Yield. For example if I have a modal dialog box with its own event loop then I want re-entry to be prevented...
by Virchanza
Sat May 27, 2023 9:30 pm
Forum: C++ Development
Topic: Prevent re-entry but do not discard the event
Replies: 15
Views: 854

Re: Prevent re-entry but do not discard the event

I have this working now the way I want it (pretty much). Here's what I do: std::atomic_flag myflag = ATOMIC_FLAG_INIT; void Dialog_Main::CallAfter_ReceiveFileShareName_FTP(uintIP const ip, string str) { assert( wxIsMainThread() ); assert( false == str.empty() ); if ( myflag.test_and_set() ) { this->...
by Virchanza
Sat May 27, 2023 6:01 pm
Forum: C++ Development
Topic: Prevent re-entry but do not discard the event
Replies: 15
Views: 854

Re: Prevent re-entry but do not discard the event

By the way in my previous code snippet I should have used a binary_semaphore instead of a mutex, otherwise there will be thread-lock. An atomic_flag would work fine too.
by Virchanza
Sat May 27, 2023 3:02 pm
Forum: C++ Development
Topic: Prevent re-entry but do not discard the event
Replies: 15
Views: 854

Re: Prevent re-entry but do not discard the event

ONEEYEMAN wrote: Sat May 27, 2023 1:47 pm the event loop is one threaded and so even if you call wxYield() other events will be processed during this call, but not this one.
I can't find anywhere in the documentation that says that the current event handler cannot be re-entered by a call to ::wxSafeYield.

Where do you get this info?
by Virchanza
Sat May 27, 2023 12:58 pm
Forum: C++ Development
Topic: Prevent re-entry but do not discard the event
Replies: 15
Views: 854

Re: Prevent re-entry but do not discard the event

I have event handlers that cannot be re-entered, for example the ' OnClick ' event for a wxButton . I also have ' CallAfter ' methods that cannot be re-entered. I'm thinking that I should handle the ' CallAfter ' methods as follows: template<typename Lambda> struct OnScopeExit { Lambda f; explicit O...
by Virchanza
Sat May 27, 2023 12:28 pm
Forum: C++ Development
Topic: Prevent re-entry but do not discard the event
Replies: 15
Views: 854

Re: Prevent re-entry but do not discard the event

doublemax wrote: Sat May 27, 2023 12:26 pm Did you actually experience re-entrancy your app?

The wxWidgets event system is single threaded, an event handler can not be interrupted by another event, unless you do something in your event handler that causes triggering the event loop.
My event handler calls '::wxSafeYield'.