fix: forgor to allocate gpu memory

This commit is contained in:
djaidjai committed 2025-01-07 13:52:50 +01:00
1 parent 04defb563f
commit d5a426e0c5
4 files changed
+9 -6

No files matched your search

+4 -2
View File
@@ -1,5 +1,6 @@
#include "MainWindow.h"
#include "cuda_runtime.h"
#include <iostream>
#include <memory>
@@ -56,7 +57,7 @@ int Window::init(float* data) {
Window::tick();
}
Window::free();
Window::free(data);
return 0;
}
@@ -73,10 +74,11 @@ int Window::init_quad(float* data) {
}
void Window::free() {
void Window::free(float* data) {
// To preserve the proper destruction order we forcefully set the quads to null (calling their destructor in the process)
// Not strictly necessary, but i saw some weird errors on exit without this so best to keep it in.
this->current_quad = nullptr;
cudaFree(data);
glfwDestroyWindow(window);
glfwTerminate();
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.