Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Window crashes when closing a window  (Read 1274 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Window crashes when closing a window
« on: October 22, 2017, 07:52:22 am »
im using SFML 2.4 and Code::blocks as IDE and also glew+glm

i've followed Hopson's tutorial on how to make minecraft in c++ with sfml
and then on closing the window i get an error like "segmentation error"

code for display.cpp
(click to show/hide)

and code for display.h
(click to show/hide)


  • SFML Team
  • Hero Member
  • *****
  • Posts: 10607
    • View Profile
    • development blog
    • Email
Re: Window crashes when closing a window
« Reply #1 on: October 22, 2017, 08:40:42 am »
Don't use hlobal SFML resources (i.e. your global window unique_ptr).

Manually dispose the unique_ptr before leaving main.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
Dev Blog: https://duerrenberger.dev/blog/