Skip to content
Snippets Groups Projects
Commit 26fd26e7 authored by Philippe Canal's avatar Philippe Canal
Browse files

Fix ROOT-5287, by calling InitializeGraphics in TCanvas::Init

gApplication->InitializeGraphics must be called after loading the Gpad library
(but *not* during the loading itself, as it need the dictionary to be fully
loaded).  Previously it was called from gSystem->Load.  Before this commit, it
was not called when the library is loaded in reaction to a missing symbol, i.e.
at 'JIT link time', by NotifyLazyFunctionCreators which calls TCling's
autoloadCallback which does *not* call InitializeGraphics.

Adding InitializeGraphics to TCling's autoloadCallback is not a viable solution
since it is being called during the 'link-phase' of the code generation (aka at
the end of llvm::JIT::getPointerToFunction) and because the JIT is not
re-entrant (it has an explicit assert against it: "Error: Recursive compilation
detected!") *and* because InitializeGraphics must load the plugin scripts ...
which means compiling.

So instead we delay the call to InitializeGraphics until TCanvas::init (and if
find other places that needs it, we will put it there too).
parent 5ba4fa65
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment