| 63 | } |
| 64 | |
| 65 | void DUChainBase::setData(DUChainBaseData* data, bool constructorCalled) |
| 66 | { |
| 67 | Q_ASSERT(data); |
| 68 | Q_ASSERT(d_ptr); |
| 69 | |
| 70 | if (d_ptr->m_dynamic) { |
| 71 | Q_ASSERT(constructorCalled); |
| 72 | DUChainItemSystem::self().deleteDynamicData(d_ptr); |
| 73 | } else if (constructorCalled) { |
| 74 | // If the data object isn't dynamic, then it is part of a central repository, and cannot be deleted here. |
| 75 | // we still need to call the destructor though |
| 76 | KDevelop::DUChainItemSystem::self().callDestructor(static_cast<DUChainBaseData*>(d_ptr)); |
| 77 | } |
| 78 | |
| 79 | d_ptr = data; |
| 80 | } |
| 81 | |
| 82 | DUChainBase::~DUChainBase() |
| 83 | { |
no test coverage detected