dxx-rebirth/similar
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
..
2d Make enumerate inherit ranges::subrange directly 2022-12-31 16:21:47 +00:00
3d Remove inline stub for swap_polygon_model_data 2023-01-07 22:17:31 +00:00
arch Use correct coefficient table for 11Khz sounds 2023-01-08 14:19:52 +00:00
editor Make partial_range_t inherit from ranges::subrange 2023-01-14 19:05:37 +00:00
main Move window existence flag to a mixin, and track using std::shared_ptr 2023-01-14 19:05:37 +00:00
misc Move SysNoHogDir to CGameArg 2023-01-07 22:17:31 +00:00