mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-30 18:49:31 +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:
parent
71ff774a44
commit
28a63989ab
@ -140,7 +140,7 @@ void run_all_callbacks() {
|
|||||||
if (cb.remaining-- == 0) {
|
if (cb.remaining-- == 0) {
|
||||||
/* run the callback as long as someone holds a pointer to it;
|
/* 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 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.remaining = cb.period - 1;
|
||||||
cb.run();
|
cb.run();
|
||||||
if (cb.wait) { ++wait; }
|
if (cb.wait) { ++wait; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user