This commit is contained in:
Nick Fisher
2025-04-02 23:00:59 +08:00
parent ddba3c35ab
commit ccda475073

View File

@@ -238,9 +238,6 @@ namespace thermion::tflutter::windows
result->Success(flutter::EncodableValue((int64_t) nullptr)); result->Success(flutter::EncodableValue((int64_t) nullptr));
} }
else if (methodCall.method_name() == "destroyContext") { else if (methodCall.method_name() == "destroyContext") {
if(_context) {
delete _context;
}
_context = std::nullptr_t(); _context = std::nullptr_t();
std::cerr << "Destroyed context" << std::endl; std::cerr << "Destroyed context" << std::endl;
result->Success(flutter::EncodableValue((int64_t)nullptr)); result->Success(flutter::EncodableValue((int64_t)nullptr));
@@ -248,7 +245,10 @@ namespace thermion::tflutter::windows
else if (methodCall.method_name() == "getDriverPlatform") else if (methodCall.method_name() == "getDriverPlatform")
{ {
if (!_context) { if (!_context) {
std::cerr << "No context, creating new one" << std::endl;
_context = new thermion::windows::vulkan::ThermionVulkanContext(); _context = new thermion::windows::vulkan::ThermionVulkanContext();
} else {
std::cerr << "Context already exists, returning existing" << std::endl;
} }
result->Success(flutter::EncodableValue((int64_t)_context->GetPlatform())); result->Success(flutter::EncodableValue((int64_t)_context->GetPlatform()));
} }