1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-29 01:58:26 +00:00

shared_ptr::unique() deprecated, use use_count()

unique() was deprecated in C++17, replace it with use_count(). We don't
need to worry about a race condition here.
This commit is contained in:
Brenden Matthews 2024-05-02 08:40:25 -04:00
parent 71ff774a44
commit 28a63989ab

View File

@ -140,7 +140,7 @@ void run_all_callbacks() {
if (cb.remaining-- == 0) {
/* run the callback as long as someone holds a pointer to it;
* if no one owns the callback, run it at most UNUSED_MAX times */
if (!i->unique() || ++cb.unused < UNUSED_MAX) {
if (i->use_count() > 1 || ++cb.unused < UNUSED_MAX) {
cb.remaining = cb.period - 1;
cb.run();
if (cb.wait) { ++wait; }