summaryrefslogtreecommitdiff
path: root/websocketprovider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'websocketprovider.cpp')
-rw-r--r--websocketprovider.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/websocketprovider.cpp b/websocketprovider.cpp
index 48782715..52b8e721 100644
--- a/websocketprovider.cpp
+++ b/websocketprovider.cpp
@@ -59,28 +59,28 @@ bool WebsocketClient::ConnectCallback(
headers[headerKeys[i]] = headerValues[i];
}
- WebsocketClient* client = (WebsocketClient*)ctxt;
+ CallbackRef<WebsocketClient> client(ctxt);
return client->Connect(host, headers);
}
bool WebsocketClient::DisconnectCallback(void* ctxt)
{
- WebsocketClient* client = (WebsocketClient*)ctxt;
+ CallbackRef<WebsocketClient> client(ctxt);
return client->Disconnect();
}
void WebsocketClient::ErrorCallback(const char* msg, void* ctxt)
{
- WebsocketClient* client = (WebsocketClient*)ctxt;
+ CallbackRef<WebsocketClient> client(ctxt);
BNNotifyWebsocketClientError(client->m_object, msg);
}
bool WebsocketClient::WriteCallback(const uint8_t* data, uint64_t len, void* ctxt)
{
- WebsocketClient* client = (WebsocketClient*)ctxt;
+ CallbackRef<WebsocketClient> client(ctxt);
return client->Write(vector<uint8_t>(data, data + len));
}