dxx-rebirth/common/arch
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
..
cocoa Pass std::span to msgbox_warning 2022-09-24 17:47:53 +00:00
macos Show current zsh version if it is too low 2021-12-18 03:24:43 +00:00
ogl Pass std::span to ogl_extensions is_ext_supported 2022-09-24 17:47:52 +00:00
sdl Move window existence flag to a mixin, and track using std::shared_ptr 2023-01-14 19:05:37 +00:00
win32 Make window_send_event a method of window 2022-12-18 23:10:39 +00:00