1
Window / Switching from debug to release triggers access violation
« on: January 29, 2020, 04:26:38 pm »
Hello,
let me preface this by acknowledging that declaring an sf::Window globally is a bad idea and it leads to undefined behavior, however I'd like to know more about this issue. I'm not looking for a solution, I'm trying to learn.
Due to how (poorly) I designed one of my apps I resorted to declaring the Window globally, the compiler (VS2019 IDE) compiles without issues in both Debug and Release mode x86. My problem starts at runtime: it goes smoothly in Release but in Debug it wont open the window throwing an access violation in the sf::Window constructor.
[TLDR] What changes between debug and release? Is it a compiler thing (does the order/schedule of compiling change?)? Is it OS dependent?
Can anyone point me in the right direction?
Note: I'm not looking for a solution to a badly design piece of software, I'm trying to understand the library (and programming in general) on a lower level.
I know it's kind of a weird and useless question so if an admin feels that this post doesn't belong please let me know, I'll be happy to remove it and ask someplace else. Cheers.
let me preface this by acknowledging that declaring an sf::Window globally is a bad idea and it leads to undefined behavior, however I'd like to know more about this issue. I'm not looking for a solution, I'm trying to learn.
Due to how (poorly) I designed one of my apps I resorted to declaring the Window globally, the compiler (VS2019 IDE) compiles without issues in both Debug and Release mode x86. My problem starts at runtime: it goes smoothly in Release but in Debug it wont open the window throwing an access violation in the sf::Window constructor.
[TLDR] What changes between debug and release? Is it a compiler thing (does the order/schedule of compiling change?)? Is it OS dependent?
Can anyone point me in the right direction?
Note: I'm not looking for a solution to a badly design piece of software, I'm trying to understand the library (and programming in general) on a lower level.
I know it's kind of a weird and useless question so if an admin feels that this post doesn't belong please let me know, I'll be happy to remove it and ask someplace else. Cheers.