From 011eabed8380f5f7d2d12833da10d805df5b3891 Mon Sep 17 00:00:00 2001 From: Tomas Maly Date: Wed, 31 Jul 2024 18:15:02 +0200 Subject: [PATCH] some asserts in steam sockets --- sources/libcore/network/steam.cpp | 10 ++++++++-- sources/libengine/graphics/shaderProgram.cpp | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sources/libcore/network/steam.cpp b/sources/libcore/network/steam.cpp index cb2979cf..4a354246 100644 --- a/sources/libcore/network/steam.cpp +++ b/sources/libcore/network/steam.cpp @@ -22,7 +22,7 @@ namespace cage { const ConfigSint32 confDebugLogLevel("cage/steamsocks/logLevel", k_ESteamNetworkingSocketsDebugOutputType_Warning); - constexpr uint32 LanesCount = 8; + constexpr uint32 LanesCount = 4; CAGE_FORCE_INLINE ISteamNetworkingSockets *sockets() { @@ -223,6 +223,7 @@ namespace cage ~Data() { + CAGE_ASSERT(sockets()); if (msg) msg->Release(); } @@ -266,7 +267,11 @@ namespace cage handleResult(sockets()->ConfigureConnectionLanes(sock, LanesCount, nullptr, nullptr)); } - ~SteamConnectionImpl() { sockets()->CloseConnection(sock, 0, nullptr, false); } + ~SteamConnectionImpl() + { + CAGE_ASSERT(sockets()); + sockets()->CloseConnection(sock, 0, nullptr, false); + } Holder> read(uint32 &channel, bool &reliable) { @@ -347,6 +352,7 @@ namespace cage ~SteamServerImpl() { + CAGE_ASSERT(sockets()); waiting.terminate(); { Holder c; diff --git a/sources/libengine/graphics/shaderProgram.cpp b/sources/libengine/graphics/shaderProgram.cpp index 61c7ecdc..88d260c9 100644 --- a/sources/libengine/graphics/shaderProgram.cpp +++ b/sources/libengine/graphics/shaderProgram.cpp @@ -770,7 +770,6 @@ namespace cage void MultiShaderProgram::setDebugName(const String &name) { - MultiShaderProgramImpl *impl = (MultiShaderProgramImpl *)this; debugName = name; }