ddraw: The ddraw surface is now always the wined3d surface's parent.
authorHenri Verbeet <hverbeet@codeweavers.com>
Fri, 25 Sep 2009 11:31:51 +0000 (13:31 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 25 Sep 2009 13:15:55 +0000 (15:15 +0200)
This GetParent() trick would now cause infinite recursion.

dlls/ddraw/surface.c

index a3f39efac37d3dd2e98948cba7e2764c3f729666..3d41d1820979ad2dd821879866a6bd24d926704a 100644 (file)
@@ -365,43 +365,6 @@ IDirectDrawSurfaceImpl_Release(IDirectDrawSurface7 *iface)
              */
             TRACE("(%p) D3D unloaded\n", This);
         }
-        else if(This->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE |
-                                                     DDSCAPS_3DDEVICE       |
-                                                     DDSCAPS_TEXTURE        ) )
-        {
-            /* It's a render target, but no swapchain was created.
-             * The IParent interfaces have to be released manually.
-             * The same applies for textures without an
-             * IWineD3DTexture object attached
-             */
-            IParent *Parent;
-
-            for(i = 0; i < MAX_COMPLEX_ATTACHED; i++)
-            {
-                if(This->complex_array[i])
-                {
-                    /* Only the topmost level can have more than 1 surfaces in the complex
-                     * attachment array(Cube texture roots), for all others there is only
-                     * one
-                     */
-                    surf = This->complex_array[i];
-                    while(surf)
-                    {
-                        IWineD3DSurface_GetParent(surf->WineD3DSurface,
-                                                  (IUnknown **) &Parent);
-                        IParent_Release(Parent);  /* For the getParent */
-                        IParent_Release(Parent);  /* To release it */
-                        surf = surf->complex_array[0];
-                    }
-                }
-            }
-
-            /* Now the top-level surface */
-            IWineD3DSurface_GetParent(This->WineD3DSurface,
-                                      (IUnknown **) &Parent);
-            IParent_Release(Parent);  /* For the getParent */
-            IParent_Release(Parent);  /* To release it */
-        }
 
         /* The refcount test shows that the palette is detached when the surface is destroyed */
         IDirectDrawSurface7_SetPalette((IDirectDrawSurface7 *)This, NULL);