wined3d: Fix ddraw-opengl surface free bug.

This commit is contained in:
Roderick Colenbrander 2007-09-10 12:18:15 +02:00 committed by Alexandre Julliard
parent 8cb25a4e2d
commit 63c06b4b38

View File

@ -366,7 +366,7 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) {
* the primary render target exists. Otherwise lastActiveRenderTarget is garbage, see above.
* When destroying the primary rt, Uninit3D will activate a context before doing anything
*/
if(device->render_targets[0]) {
if(device->render_targets && device->render_targets[0]) {
ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
}