OSDN Git Service

close iterator before cloning in QTextBoundaryFinderPrivate::operator=()
authorIvailo Monev <xakepa10@laimg.moc>
Sat, 18 Jan 2020 09:09:32 +0000 (09:09 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Sat, 18 Jan 2020 09:09:32 +0000 (09:09 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/tools/qtextboundaryfinder.cpp

index fedbec6..51c17e0 100644 (file)
@@ -82,6 +82,10 @@ QTextBoundaryFinderPrivate& QTextBoundaryFinderPrivate::operator=(const QTextBou
     pos = other.pos;
     string = other.string;
 
+    if (breakiter) {
+        ubrk_close(breakiter);
+    }
+
     UErrorCode error = U_ZERO_ERROR;
     breakiter = ubrk_safeClone(other.breakiter, Q_NULLPTR, Q_NULLPTR, &error);
     if (Q_UNLIKELY(U_FAILURE(error))) {