]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
allow framebuffer objects to be used where non-power of two textures are not required
[xonotic/darkplaces.git] / snd_main.c
index 614b16879dcb0dffc8578f0f4a09b19a4eec7dd8..1fb7cd54d8e7433d84c8645feba33dcdbeb99664 100644 (file)
@@ -1765,17 +1765,17 @@ void S_StopChannel (unsigned int channel_ind, qboolean lockmutex, qboolean frees
        
        ch = &channels[channel_ind];
        sfx = ch->sfx;
-       if (ch->sfx != NULL)
+       if (sfx != NULL)
        {
                if (sfx->fetcher != NULL && sfx->fetcher->stopchannel != NULL)
                        sfx->fetcher->stopchannel(ch);
                ch->fetcher_data = NULL;
                ch->sfx = NULL;
+               if (freesfx)
+                       S_FreeSfx(sfx, true);
        }
        if (lockmutex && !simsound)
                SndSys_UnlockRenderBuffer();
-       if (freesfx)
-               S_FreeSfx(sfx, true);
 }