Merge lp:~saviq/qtmir/openurl-keep-bytearray into lp:qtmir

Proposed by Michał Sawicz on 2015-01-09
Status: Merged
Approved by: Gerry Boland on 2015-01-10
Approved revision: 300
Merged at revision: 303
Proposed branch: lp:~saviq/qtmir/openurl-keep-bytearray
Merge into: lp:qtmir
Diff against target: 20 lines (+3/-1)
1 file modified
src/platforms/mirserver/services.cpp (+3/-1)
To merge this branch: bzr merge lp:~saviq/qtmir/openurl-keep-bytearray
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-01-09
Gerry Boland 2015-01-09 Approve on 2015-01-09
Review via email: mp+246017@code.launchpad.net

Commit Message

Declare the QByteArray in callDispatcher so it doesn't get deleted before it's copied.

To post a comment you must log in.
Gerry Boland (gerboland) wrote :

Looks reasonable, as the temporary QByteArray had gone out of scope by the time url_dispatch_send fired.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platforms/mirserver/services.cpp'
2--- src/platforms/mirserver/services.cpp 2014-06-16 18:29:36 +0000
3+++ src/platforms/mirserver/services.cpp 2015-01-09 22:18:11 +0000
4@@ -17,6 +17,7 @@
5 #include "services.h"
6
7 #include <QUrl>
8+#include <QByteArray>
9
10 #include <url-dispatcher.h>
11
12@@ -32,7 +33,8 @@
13
14 bool Services::callDispatcher(const QUrl &qUrl)
15 {
16- const char *url = qUrl.toEncoded().constData();
17+ QByteArray encoded = qUrl.toEncoded();
18+ const char *url = encoded.constData();
19
20 url_dispatch_send(url, nullptr /*dispatch_callback*/, nullptr /*callback_data*/);
21

Subscribers

People subscribed via source and target branches