Код: Выделить всё
Invalid read of size 4
at 0x4C3DEF4: pthread_mutex_lock@@GLIBC_2.2.5 (pthread_mutex_lock.c:80)
by 0x51DB32A: ??? (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.22.0)
by 0x51DB5DB: wl_display_dispatch_queue_pending (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.22.0)
by 0x171ABE: handleEvents (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x171978: _glfwPollEventsWayland (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x156B05: glfwPollEvents (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x11EF64: Hamster::Window::Update(bool) (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x119657: Hamster::Application::Run() (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x116EA0: main (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
Address 0x4de7bb8 is 296 bytes inside a block of size 376 free'd
at 0x484B27F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x16BFA4: _glfwTerminateWayland (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x14B6E6: terminate (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x14B7AD: glfwTerminate (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x11EEB5: Hamster::Window::~Window() (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x11AE8A: std::default_delete::operator()(Hamster::Window*) const (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x11ADAF: std::__uniq_ptr_impl::reset(Hamster::Window*) (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x11A7BC: std::unique_ptr::reset(Hamster::Window*) (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x1198E4: Hamster::Application::Close(Hamster::WindowCloseEvent&) (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x119D3F: Hamster::Application::Application()::$_0::operator()(Hamster::Event&) const (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x119D01: void std::__invoke_impl(std::__invoke_other, Hamster::Application::Application()::$_0&, Hamster::Event&) (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x119C91: std::enable_if::type std::__invoke_r(Hamster::Application::Application()::$_0&, Hamster::Event&) (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
Block was alloc'd at
at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x51DE0F3: wl_display_connect_to_fd (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.22.0)
by 0x51DE38D: wl_display_connect (in /usr/lib/x86_64-linux-gnu/libwayland-client.so.0.22.0)
by 0x16A2E0: _glfwConnectWayland (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x152135: _glfwSelectPlatform (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x14B3ED: glfwInit (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x11ECF9: Hamster::Window::Window(Hamster::WindowProps const&) (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x11A478: std::_MakeUniq::__single_object std::make_unique(Hamster::WindowProps&) (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x118E48: Hamster::Application::Application() (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
by 0x116CE7: main (in /home/jaden/Documents/dev/Hamster/Hamster-App/Hamster-App)
Код: Выделить всё
Application.cppКод: Выделить всё
Application::Application() {
WindowProps props;
m_Window = std::make_unique(props);
Renderer::Init(props.width, props.height);
m_Dispatcher = std::make_unique();
m_Window->SetWindowEventDispatcher(m_Dispatcher.get());
m_Dispatcher->Subscribe(
WindowClose,
FORWARD_CALLBACK_FUNCTION(Application::Close, WindowCloseEvent));
glfwSetWindowCloseCallback(
m_Window->GetGLFWWindowPointer(), [](GLFWwindow *windowGLFW) {
EventDispatcher *dispatcher =
(EventDispatcher *)glfwGetWindowUserPointer(windowGLFW);
WindowCloseEvent e;
dispatcher->Post(e);
});
}
Application::~Application() {
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78507334/invalid-read-during-glfw-handling-events[/url]