Changeset View
Changeset View
Standalone View
Standalone View
mainWindow/kpMainWindow_File.cpp
Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Line(s) | 185 | { | |||
---|---|---|---|---|---|
188 | // | 188 | // | ||
189 | // So afterwards, the URL ref, our method is given, points to an | 189 | // So afterwards, the URL ref, our method is given, points to an | ||
190 | // element in this now-cleared map (see KRecentFilesAction::urlSelected(QAction*)). | 190 | // element in this now-cleared map (see KRecentFilesAction::urlSelected(QAction*)). | ||
191 | // Accessing it would result in a crash. | 191 | // Accessing it would result in a crash. | ||
192 | // | 192 | // | ||
193 | // To avoid the crash, make a copy of it before calling | 193 | // To avoid the crash, make a copy of it before calling | ||
194 | // loadEntries() and use this copy, instead of the to-be-dangling | 194 | // loadEntries() and use this copy, instead of the to-be-dangling | ||
195 | // ref. | 195 | // ref. | ||
196 | const QUrl& url = url_; | 196 | const QUrl url = url_; // DO NOT MAKE IT A REFERENCE, THE CALL BELOW TO loadEntries DESTROYS url_ | ||
197 | 197 | | |||
198 | #if DEBUG_KP_MAIN_WINDOW | 198 | #if DEBUG_KP_MAIN_WINDOW | ||
199 | qCDebug(kpLogMainWindow) << "kpMainWindow::addRecentURL(" << url << ")"; | 199 | qCDebug(kpLogMainWindow) << "kpMainWindow::addRecentURL(" << url << ")"; | ||
200 | #endif | 200 | #endif | ||
201 | if (url.isEmpty ()) | 201 | if (url.isEmpty ()) | ||
202 | return; | 202 | return; | ||
203 | 203 | | |||
204 | 204 | | |||
▲ Show 20 Lines • Show All 1320 Lines • Show Last 20 Lines |