上周找到在FragmentRequest的析构函数时,由于m_deleteChannelVector为0,没有进入if语句进行删除操作。
m_deleteChannelVector 这个变量在整个FragmentRequest类里面只出现了两次: 构造函数初始化和析构函数里。
70 FragmentRequest::FragmentRequest(const unsigned int level1Id, 71 std::vector<DataChannel*>* dataChannel, 72 bool deleteChannelVector, 73 bool doMonitoring, 74 bool doRelease, 75 FragmentBuilder* builder, 76 const NodeID destination, 77 const unsigned int transactionId, 78 DFOutputQueue<unsigned int>* releaseQueue) : 79 Request(dataChannel), 80 m_deleteChannelVector(deleteChannelVector), 81 m_doMonitoring(doMonitoring), 82 m_doRelease(doRelease), 83 m_builder(builder), 84 m_level1Id(level1Id), 85 m_transactionId(transactionId), 86 m_destination(destination), 87 m_releaseQueue(releaseQueue) 88 { 89 m_eventFragment = 0; 90 } 91 92 FragmentRequest::~FragmentRequest() { 93 std::cout << "~FragmentRequest" << std::endl; 94 if (m_deleteChannelVector) { 95 delete m_dataChannels; 96 } 97 }
所以,要找到Request初始化的地方。Request在使用时是从requestQueue里pop出来一个,然后执行和删除的。
在IOManager.cpp里面应该有request的push操作。
(批注:要找Request初始化的地方是正确的思路,但是找法是有一些问题。应该在tdaq总目录下查找,最终发现Request的初始化是在ROSIO包里,而且Request还有连个子类。)