File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ FARPROC dlsym(void *library, const char *function_name)
119
119
#include " TClass.h"
120
120
#include " TClassEdit.h"
121
121
#include " TClassGenerator.h"
122
+ #include " TDirectory.h"
122
123
#include " TDataType.h"
123
124
#include " TStyle.h"
124
125
#include " TObjectTable.h"
@@ -238,14 +239,10 @@ void TROOT::WriteCloseAllFiles()
238
239
TIter next (gROOT ->GetListOfFiles ());
239
240
while (TObject *obj = next ()) {
240
241
if (obj && obj->InheritsFrom (TClass::GetClass (" TFile" , kFALSE , kTRUE ))) {
241
- TMethodCall callIsWritable (obj->IsA (), " IsWritable" , " " );
242
- Longptr_t retLong = 0 ;
243
- callIsWritable.Execute ((void *)(obj), retLong);
244
- if (retLong == 1 ) {
245
- TMethodCall callWrite (obj->IsA (), " Write" , " " );
246
- callWrite.Execute ((void *)(obj));
247
- TMethodCall callClose (obj->IsA (), " Close" , " " );
248
- callClose.Execute ((void *)(obj));
242
+ auto fobj = static_cast <TDirectory *>(obj);
243
+ if (fobj->IsWritable ()) {
244
+ fobj->Write ();
245
+ fobj->Close ();
249
246
}
250
247
}
251
248
}
You can’t perform that action at this time.
0 commit comments