Fix m_callbacks resource issue (#289)

This commit is contained in:
Christian Semmler 2025-06-12 12:37:51 -07:00 committed by GitHub
parent 098e2a6894
commit b95ca4b2a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View File

@ -268,7 +268,7 @@ void Direct3DRMSoftwareRenderer::DrawTriangleProjected(
Uint8 r, g, b;
SDL_Color c0 = ApplyLighting(v0.position, v0.normal, appearance);
SDL_Color c1, c2;
SDL_Color c1 = {}, c2 = {};
if (!appearance.flat) {
c1 = ApplyLighting(v1.position, v1.normal, appearance);
c2 = ApplyLighting(v2.position, v2.normal, appearance);

View File

@ -14,8 +14,8 @@
#include <functional>
#include <math.h>
Direct3DRMViewportImpl::Direct3DRMViewportImpl(DWORD width, DWORD height, Direct3DRMRenderer* rendere)
: m_width(width), m_height(height), m_renderer(rendere)
Direct3DRMViewportImpl::Direct3DRMViewportImpl(DWORD width, DWORD height, Direct3DRMRenderer* renderer)
: m_width(width), m_height(height), m_renderer(renderer)
{
}

View File

@ -7,6 +7,13 @@
template <typename T>
struct Direct3DRMObjectBaseImpl : public T {
Direct3DRMObjectBaseImpl() : T() {}
Direct3DRMObjectBaseImpl(const Direct3DRMObjectBaseImpl& other) : m_appData(other.m_appData), T(other)
{
if (other.m_name) {
m_name = SDL_strdup(other.m_name);
}
}
ULONG Release() override
{
if (T::m_refCount == 1) {