-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Am 2015-11-19 um 20:34 schrieb Riccardo Bortolato:
@@ -532,10 +529,9 @@ static void ddraw_surface_cleanup(struct ddraw_surface *surface) ...
- wined3d_texture_decref(surface->wined3d_texture);
- if (surface->sub_resource_idx == 0)
wined3d_texture_decref(surface->wined3d_texture);
If I follow this correctly the unconditionally released reference is the one added by ddraw_surface_init, and the one that's released if sub_resource_idx == 0 is the initial reference that the texture is returned with from wined3d_texture_create. In this case I think it would be better to release the idx == 0 reference after calling wined3d_surface_create and retrieving the ddraw parent. Please correct me if I am wrong...
(This would also remove a non-obvious non-problem in the flip code if one of the involved surfaces has a non-zero index and the other one has a zero index and holds an extra reference to its wined3d texture. In practice it's a non-issue because swapchains never have mipmaps and the code swaps both the wined3d texture and the sub resource index)