Loaded macro not running twice

I created a script to load data into a TGraph (loadData.C) and then call it from a second script (callLoadData.C). callLoadData.C runs ok the first time but fails the second time.

The minimal code to show the problem is:

loadData.C (103 Bytes)

callLoadData.C (71 Bytes)

The message error is:

.x callLoadData.C
Function callLoadData() busy. loaded after “/home/usuario/amiga/Reconstruction/v6/analisis/bug/./loadData.C”
Error: G__unloadfile() Can not unload “/home/usuario/amiga/Reconstruction/v6/analisis/bug/./loadData.C”, file busy callLoadData.C:5:

The problem does not happen if the loadData does not create the TGraph. The ROOT version is 5.34/10



Although this is a very old post, it still comes up in searches and has quite a few views. Adding links to further discussion of this problem in case someone ends up here: