diff options
author | Yurii Zubrytskyi <zyy@google.com> | 2016-11-08 10:31:33 -0800 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2016-11-09 14:48:02 +0100 |
commit | e74ae794a63c3cdf42ebb762cfea0d1bb0e5e20b (patch) | |
tree | 970e787d13234eddeb79d0bd8182d885c8f9bee5 | |
parent | 74c107cd1b2ecc2a1614eb362fd8fdb7d783a091 (diff) | |
download | qemu-android-2.7.tar.gz |
[qemu2] Clipboard pipe update to fix crash on guest restartqemu-android-2.7
Store the whole shared_ptr<> instead of a raw ptr when updating
clipboard data; this makes sure pipe doesn't get deleted if
guest decides to close it in the middle of operation.
Change-Id: I76a2680c4adf482512d7ef4eadfeb7a3e0d6582e
-rw-r--r-- | android-qemu2-glue/qemu-clipboard-agent-impl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/android-qemu2-glue/qemu-clipboard-agent-impl.cpp b/android-qemu2-glue/qemu-clipboard-agent-impl.cpp index 0e7cf67dca..b2a4a9ab6f 100644 --- a/android-qemu2-glue/qemu-clipboard-agent-impl.cpp +++ b/android-qemu2-glue/qemu-clipboard-agent-impl.cpp @@ -19,8 +19,8 @@ static void set_guest_clipboard_callback( } static void set_guest_clipboard_contents(const uint8_t* buf, size_t len) { - android::emulation::ClipboardPipe* pipe = - android::emulation::ClipboardPipe::Service::getPipeInstance(); + const auto pipe = + android::emulation::ClipboardPipe::Service::getPipe(); if (pipe) { pipe->setGuestClipboardContents(buf, len); } |