mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Fix copy and move semantics for DnD proxy handle
This commit is contained in:
@@ -166,27 +166,10 @@ WineXdndProxy::Handle::~Handle() noexcept {
|
|||||||
WineXdndProxy::Handle::Handle(const Handle& o) noexcept : proxy(o.proxy) {
|
WineXdndProxy::Handle::Handle(const Handle& o) noexcept : proxy(o.proxy) {
|
||||||
instance_reference_count += 1;
|
instance_reference_count += 1;
|
||||||
}
|
}
|
||||||
WineXdndProxy::Handle& WineXdndProxy::Handle::operator=(
|
|
||||||
const Handle& o) noexcept {
|
|
||||||
if (&o != this) {
|
|
||||||
instance_reference_count += 1;
|
|
||||||
proxy = o.proxy;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
WineXdndProxy::Handle::Handle(Handle&& o) noexcept : proxy(o.proxy) {
|
||||||
}
|
|
||||||
|
|
||||||
WineXdndProxy::Handle::Handle(Handle&& o) noexcept : proxy(std::move(o.proxy)) {
|
|
||||||
instance_reference_count += 1;
|
instance_reference_count += 1;
|
||||||
}
|
}
|
||||||
WineXdndProxy::Handle& WineXdndProxy::Handle::operator=(Handle&& o) noexcept {
|
|
||||||
if (&o != this) {
|
|
||||||
instance_reference_count += 1;
|
|
||||||
proxy = std::move(o.proxy);
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
WineXdndProxy::Handle WineXdndProxy::init_proxy() {
|
WineXdndProxy::Handle WineXdndProxy::init_proxy() {
|
||||||
// We're doing a bit of a hybrid between a COM-style reference counted smart
|
// We're doing a bit of a hybrid between a COM-style reference counted smart
|
||||||
|
|||||||
@@ -60,10 +60,10 @@ class WineXdndProxy {
|
|||||||
~Handle() noexcept;
|
~Handle() noexcept;
|
||||||
|
|
||||||
Handle(const Handle&) noexcept;
|
Handle(const Handle&) noexcept;
|
||||||
Handle& operator=(const Handle&) noexcept;
|
Handle& operator=(const Handle&) noexcept = default;
|
||||||
|
|
||||||
Handle(Handle&&) noexcept;
|
Handle(Handle&&) noexcept;
|
||||||
Handle& operator=(Handle&&) noexcept;
|
Handle& operator=(Handle&&) noexcept = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WineXdndProxy* proxy;
|
WineXdndProxy* proxy;
|
||||||
|
|||||||
Reference in New Issue
Block a user