User Tools

Site Tools


root:ownershippyroot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

root:ownershippyroot [2011/06/18 12:12] – created decianmroot:ownershippyroot [2011/06/18 12:13] (current) decianm
Line 10: Line 10:
     canv = TCanvas("canv"+str(i))     canv = TCanvas("canv"+str(i))
 </code> </code>
 +
 +To avoid this, you can tell python not to take ownership of these objects:
 +<code python>
 +from ROOT import *
 +import ROOT
 +
 +for i in range(0,10):
 +    canv = TCanvas("canv"+str(i))
 +    ROOT.SetOwnership(canv, False)
 +</code>
 +
 +will give you 10 canvases after having executed this script.
  
  
root/ownershippyroot.txt · Last modified: 2011/06/18 12:13 by decianm