From ac07604a12b4d4a08e19f5096f161649c85bd57d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 20 Aug 2016 11:41:09 +0200 Subject: options/connector: spew warning when init/deinit mismatch --- options/connector.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'options') diff --git a/options/connector.cpp b/options/connector.cpp index c721971d..ba460b1f 100644 --- a/options/connector.cpp +++ b/options/connector.cpp @@ -11,6 +11,9 @@ void connector::on_value_destructed(const QString& name, const base_value* val) QMutexLocker l(get_mtx()); auto it = connected_values.find(name); + + bool ok = false; + if (it != connected_values.end()) { std::vector& values = (*it).second; @@ -19,10 +22,16 @@ void connector::on_value_destructed(const QString& name, const base_value* val) if (*it == val) { values.erase(it); + ok = true; break; } } } + + if (!ok) + qWarning() << "connector: bundle destructed without creating;" + << "name" << name + << "ptr" << quintptr(val); } void connector::on_value_created(const QString& name, const base_value* val) -- cgit v1.2.3