diff --git a/src/qtlibtorrent/alertdispatcher.cpp b/src/qtlibtorrent/alertdispatcher.cpp index 80d5291ff..b9d3a7a53 100644 --- a/src/qtlibtorrent/alertdispatcher.cpp +++ b/src/qtlibtorrent/alertdispatcher.cpp @@ -82,13 +82,21 @@ void QAlertDispatcher::getPendingAlerts(std::deque& out, uns void QAlertDispatcher::dispatch(QSharedPointer > tag, std::auto_ptr alert_ptr) { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) + QAlertDispatcher* that = tag->loadAcquire(); +#else QAlertDispatcher* that = *tag; +#endif if (!that) return; QMutexLocker lock(&(that->alerts_mutex)); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) + if (!tag->load()) +#else if (!*tag) +#endif return; bool was_empty = that->alerts.empty();