1 Jun 2004 15:03
[ROOT] tfile->Write() kills other class members
Patrick Marks <pmarks <at> gmail.com>
2004-06-01 13:03:00 GMT
2004-06-01 13:03:00 GMT
Hello,
I'm working on a Visual c++ data acquistion program and am storing my
data to a root file. An object, which does not inherit from a root
object manages the data taking, and contains pointers to a TTree,
TFile, the DAQ control structures, and a 'sync' struct written to by
another thread that controls the data taking. THe control thread
inherits from TGMainFrame. Everything works, data is written to my
root file. The problem is that when I call tfile->Close() or
tfile->Write() from the DAQ object it clobbers the other members of
the class. Below is a brief outline of my code. Any ideas why writing
or closing the TFile interferes with my object -- the object ownership
rules don't seem to suggest that the objects will be owned by the
file, though i can't tell for sure. Thanks for any help!
Patrick Marks
class MyGUI : TGMainFrame {
MyDAQ *daq;
struct sync *control;
}
void MyGUI::DoDAQ() {
daq = new MyDAQ();
control->status = START;
// Some code to start MyDAQ::Run in a new thread
(Continue reading)
RSS Feed