dxx-rebirth/common/arch/sdl
Kp 407ab585a8 Move window existence flag to a mixin, and track using std::shared_ptr
gcc-12 does enough escape analysis to notice that
newmenu::process_until_closed stores the address of a stack local into a
heap-allocated structure, but not enough analysis to notice that the
stack variable always outlives the escaped address.  The compiler then
warns about the address escaping the local scope.  Reworking the calling
code not to do this is somewhat invasive, and gcc seems unlikely to
change behavior.  Switch to a less efficient implementation that does
not provoke a compiler warning:

- Store a shared_ptr<bool> in the object
- In the object's destructor, write through the pointer to clear the
  shared boolean
- In the caller, store a copy of the shared_ptr<bool> as a local, and
  use that copy to monitor the shared boolean

This is similar to a change proposed by JoeNotCharles
<10a2b2d337>,
but differs in its details.  Among other things, this version takes the
opportunity to move the variable out to a mixin, so that only windows
which expect to be tracked can be tracked.  Previously, all windows were
capable of this, even though most never needed it.
2023-01-14 19:05:37 +00:00
..
digi_mixer_music.cpp Fix SDL2 double-free on failure to load music 2022-09-24 17:47:53 +00:00
event.cpp Pass ranges::subrange to event_poll_state::process_event_batch 2022-12-31 16:21:47 +00:00
joy.cpp Move various static functions into anonymous namespace 2022-07-09 13:39:29 +00:00
key.cpp Fix OS X clang build 2022-10-31 00:51:32 +00:00
mouse.cpp Move various static functions into anonymous namespace 2022-07-09 13:39:29 +00:00
rbaudio.cpp Fix OS X clang build 2022-10-31 00:51:32 +00:00
timer.cpp Switch most in-tree http:// links to https:// 2018-09-02 00:57:29 +00:00
window.cpp Move window existence flag to a mixin, and track using std::shared_ptr 2023-01-14 19:05:37 +00:00