[DEV] correct signal destruction
This commit is contained in:
parent
dd8296fd60
commit
0a4f400439
@ -28,6 +28,18 @@ void esignal::Interface::signalAdd(esignal::Base* _pointerOnSignal) {
|
|||||||
m_list.push_back(_pointerOnSignal);
|
m_list.push_back(_pointerOnSignal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void esignal::Interface::signalRemove(esignal::Base* _pointerOnSignal) {
|
||||||
|
auto it = m_list.begin();
|
||||||
|
while (it != m_list.end()) {
|
||||||
|
if ( *it == nullptr
|
||||||
|
|| *it == _pointerOnSignal) {
|
||||||
|
it = m_list.erase(it);
|
||||||
|
} else {
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> esignal::Interface::signalGetAll() const {
|
std::vector<std::string> esignal::Interface::signalGetAll() const {
|
||||||
std::vector<std::string> out;
|
std::vector<std::string> out;
|
||||||
for (auto &it : m_list) {
|
for (auto &it : m_list) {
|
||||||
|
@ -28,10 +28,10 @@ namespace esignal {
|
|||||||
/**
|
/**
|
||||||
* @brief Register a parameter class pointer in the List of parameters
|
* @brief Register a parameter class pointer in the List of parameters
|
||||||
* @note This class does not destroy the parameter pointer!!!
|
* @note This class does not destroy the parameter pointer!!!
|
||||||
* @param[in] pointerOnParameter Pointer on the parameter that might be added.
|
* @param[in] _pointerOnSignal Pointer on the signal that might be added.
|
||||||
*/
|
*/
|
||||||
void signalAdd(esignal::Base* _pointerOnParameter);
|
void signalAdd(esignal::Base* _pointerOnSignal);
|
||||||
void signalRemove(esignal::Base* _pointerOnParameter);
|
void signalRemove(esignal::Base* _pointerOnSignal);
|
||||||
/**
|
/**
|
||||||
* @brief Get All the signal list:
|
* @brief Get All the signal list:
|
||||||
* @return vector on all the signals names
|
* @return vector on all the signals names
|
||||||
|
@ -71,6 +71,9 @@ namespace esignal {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
~LockSharedPtrRef() {
|
~LockSharedPtrRef() {
|
||||||
|
if (m_counter == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
int64_t count = m_counter->dec();
|
int64_t count = m_counter->dec();
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user