Commit c5a8b933 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Unset the primary surface's palette when the palette is released.

parent e0b68129
...@@ -379,6 +379,7 @@ struct ddraw_palette ...@@ -379,6 +379,7 @@ struct ddraw_palette
LONG ref; LONG ref;
struct wined3d_palette *wineD3DPalette; struct wined3d_palette *wineD3DPalette;
struct ddraw *ddraw;
IUnknown *ifaceToRelease; IUnknown *ifaceToRelease;
DWORD flags; DWORD flags;
}; };
......
...@@ -94,10 +94,10 @@ static ULONG WINAPI ddraw_palette_Release(IDirectDrawPalette *iface) ...@@ -94,10 +94,10 @@ static ULONG WINAPI ddraw_palette_Release(IDirectDrawPalette *iface)
{ {
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_palette_decref(This->wineD3DPalette); wined3d_palette_decref(This->wineD3DPalette);
if(This->ifaceToRelease) if ((This->flags & DDPCAPS_PRIMARYSURFACE) && This->ddraw->primary)
{ This->ddraw->primary->palette = NULL;
if (This->ifaceToRelease)
IUnknown_Release(This->ifaceToRelease); IUnknown_Release(This->ifaceToRelease);
}
wined3d_mutex_unlock(); wined3d_mutex_unlock();
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
...@@ -251,6 +251,7 @@ HRESULT ddraw_palette_init(struct ddraw_palette *palette, ...@@ -251,6 +251,7 @@ HRESULT ddraw_palette_init(struct ddraw_palette *palette,
return hr; return hr;
} }
palette->ddraw = ddraw;
palette->ifaceToRelease = (IUnknown *)&ddraw->IDirectDraw7_iface; palette->ifaceToRelease = (IUnknown *)&ddraw->IDirectDraw7_iface;
IUnknown_AddRef(palette->ifaceToRelease); IUnknown_AddRef(palette->ifaceToRelease);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment