Skip to content
Snippets Groups Projects
Commit 249e8a38 authored by Bertrand Bellenot's avatar Bertrand Bellenot
Browse files

Fix a memory leak when browsing TList inside a file (don't read the list...

Fix a memory leak when browsing TList inside a file (don't read the list content each time one click on the list). Thanks Axel and Martin Vala for the test case.


git-svn-id: http://root.cern.ch/svn/root/trunk@43529 27541ba8-7e3a-0410-8455-c3a389f83636
parent 66de0bda
No related branches found
No related tags found
No related merge requests found
...@@ -1026,7 +1026,7 @@ void TGFileBrowser::Clicked(TGListTreeItem *item, Int_t btn, Int_t x, Int_t y) ...@@ -1026,7 +1026,7 @@ void TGFileBrowser::Clicked(TGListTreeItem *item, Int_t btn, Int_t x, Int_t y)
// list tree item by RecursiveRemove() // list tree item by RecursiveRemove()
// it is better to read the object each time anyway, // it is better to read the object each time anyway,
// as it may have changed in the file // as it may have changed in the file
if (obj->InheritsFrom("TDirectory")) if (obj->InheritsFrom("TDirectory") || obj->InheritsFrom("TList"))
item->SetUserData(obj); item->SetUserData(obj);
} }
} }
...@@ -1244,7 +1244,7 @@ void TGFileBrowser::DoubleClicked(TGListTreeItem *item, Int_t /*btn*/) ...@@ -1244,7 +1244,7 @@ void TGFileBrowser::DoubleClicked(TGListTreeItem *item, Int_t /*btn*/)
// list tree item by RecursiveRemove() // list tree item by RecursiveRemove()
// it is better to read the object each time anyway, // it is better to read the object each time anyway,
// as it may have changed in the file // as it may have changed in the file
if (obj->InheritsFrom("TDirectory")) if (obj->InheritsFrom("TDirectory") || obj->InheritsFrom("TList"))
item->SetUserData(obj); item->SetUserData(obj);
} }
} }
......
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