Closed Jofagi closed 8 months ago
BaseCodeGenerator::ParseImageProperties() is used to determine if a function needs to be generated in the src file for Embed, SVG. It has nothing to do with Art files, so setting it most certainingly doesn't belong in a threaded function.
A better choice would be BaseCodeGenerator::GatherGeneratorIncludes() since that is not threaded. That function already calls else if (iter.type() == type_image)
so it should be fairly straightforward to set the flag there.
Thanks for tracking this down Jofagi -- because it was threaded, it would indeed show up rarely. I'll check in a fix tomorrow.
The fix will appear in the 1/6 Daily build.
I noticed that sometimes the line
#include <wx/artprov.h>
of generated CPP files is missing.I've got this issue for quite a while now but could not reliably reproduce it so far. I still can't, but now I looked at the source and maybe found the problem:
GenerateCppClass()
clears them_NeedArtProviderHeader
flag, then starts a thread that runsParseImageProperties()
which sets that flag.The flag gets used in Line 420 but the thread gets
join()
-ed only many lines later.