wxDC usage in a thread
Harry
"harry dot news at armadillo dot fr" at a.mx.sunsite.dk
Wed Feb 6 06:32:41 PST 2008
Vadim,
I was asking myself whether this will not break existing applications,
but I don't know wx well enough to answer.
In my case I have tested this by taking out all calls to SetBackground()
and haven't noticed any change,
but this isn't a definitive proof.
Regards
Harry
Vadim Zeitlin wrote:
> On Wed, 06 Feb 2008 14:31:11 +0100 Harry <"harry dot news at armadillo dot fr"@a.mx.sunsite.dk> wrote:
>
> H> which specifies the following member initialization:
> H> , m_backgroundBrush(*wxTRANSPARENT_BRUSH)
> H>
> H> As the stock item wxTRANSPARENT_BRUSH is probably already allocated by
> H> and used by
> H> the main thread, its concurrent usage from a thread may destroy its
> H> reference counting,
> H> since reference counting isn't thread-safe.
> H>
> H> I've solved the problem by replacing this member initialization by:
> H> , m_backgroundBrush()
> H>
> H> Does anybody have an objection to this, before I contribute it as a patch ?
>
> Are you sure that this doesn't result in any changes in the behaviour?
> I.e. is invalid brush treated the same as transparent one everywhere? I
> don't think so but I might be missing something...
>
> Regards,
> VZ
>
>
More information about the wx-users
mailing list