From ccda4750733b095adc66667b841e7500a267be46 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 2 Apr 2025 23:00:59 +0800 Subject: [PATCH] logging --- .../thermion_flutter/windows/thermion_flutter_plugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp b/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp index 87cf4914..6fc9777b 100644 --- a/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp +++ b/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp @@ -238,9 +238,6 @@ namespace thermion::tflutter::windows result->Success(flutter::EncodableValue((int64_t) nullptr)); } else if (methodCall.method_name() == "destroyContext") { - if(_context) { - delete _context; - } _context = std::nullptr_t(); std::cerr << "Destroyed context" << std::endl; result->Success(flutter::EncodableValue((int64_t)nullptr)); @@ -248,7 +245,10 @@ namespace thermion::tflutter::windows else if (methodCall.method_name() == "getDriverPlatform") { if (!_context) { + std::cerr << "No context, creating new one" << std::endl; _context = new thermion::windows::vulkan::ThermionVulkanContext(); + } else { + std::cerr << "Context already exists, returning existing" << std::endl; } result->Success(flutter::EncodableValue((int64_t)_context->GetPlatform())); }