(svn r7205) -Fix [FS#350, SF#1560913]: Window allocation and deletion messed with the actual window
structs inside their array, and possibly invalidating pointers higher up. Meaning that any function called within an wndproc could cause unknown/invalid pointers once control was returned to this function. Solved by the introduction of an extra abstraction layer, an array of z-window positions that is only concerned with the pointers.
This commit is contained in:
6
sound.c
6
sound.c
@@ -194,12 +194,12 @@ void SndCopyToPool(void)
|
||||
|
||||
static void SndPlayScreenCoordFx(SoundFx sound, int x, int y)
|
||||
{
|
||||
const Window *w;
|
||||
const Window* const *wz;
|
||||
|
||||
if (msf.effect_vol == 0) return;
|
||||
|
||||
for (w = _windows; w != _last_window; w++) {
|
||||
const ViewPort* vp = w->viewport;
|
||||
FOR_ALL_WINDOWS(wz) {
|
||||
const ViewPort *vp = (*wz)->viewport;
|
||||
|
||||
if (vp != NULL &&
|
||||
IS_INSIDE_1D(x, vp->virtual_left, vp->virtual_width) &&
|
||||
|
||||
Reference in New Issue
Block a user