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 283bbd3..ed988ca 100644 --- a/src/gui/embedded/qsoundqss_qws.cpp +++ b/src/gui/embedded/qsoundqss_qws.cpp @@ -1036,24 +1036,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; + } } } } |