diff options
Diffstat (limited to 'src/gui/embedded/qsoundqss_qws.cpp')
-rw-r--r-- | src/gui/embedded/qsoundqss_qws.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp index a45d0fe..e239e14 100644 --- a/src/gui/embedded/qsoundqss_qws.cpp +++ b/src/gui/embedded/qsoundqss_qws.cpp @@ -1037,24 +1037,28 @@ void QWSSoundServerPrivate::stopFile(int wid, int sid) void QWSSoundServerPrivate::stopAll(int wid) { QWSSoundServerProvider *bucket; - QList<QWSSoundServerProvider*>::Iterator it = active.begin(); - while (it != active.end()) { - bucket = *it; - if (bucket->groupId() == wid) { - it = active.erase(it); - delete bucket; - } else { - ++it; + if (!active.isEmpty()) { + QList<QWSSoundServerProvider*>::Iterator it = active.begin(); + while (it != active.end()) { + bucket = *it; + if (bucket->groupId() == wid) { + it = active.erase(it); + delete bucket; + } else { + ++it; + } } } - it = inactive.begin(); - while (it != inactive.end()) { - bucket = *it; - if (bucket->groupId() == wid) { - it = inactive.erase(it); - delete bucket; - } else { - ++it; + if (!inactive.isEmpty()) { + QList<QWSSoundServerProvider*>::Iterator it = inactive.begin(); + while (it != inactive.end()) { + bucket = *it; + if (bucket->groupId() == wid) { + it = inactive.erase(it); + delete bucket; + } else { + ++it; + } } } } |