-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
- From patch 1:
- hr = init_device(object, 1, iface, ddraw, render_target, width, height);
- if (FAILED(hr))
d3drm_device_destroy(object);
- else
*device = IDirect3DRMDevice_from_impl(object);
Aren't you leaking ddraw here? It's possible that d3drm_device_destroy destroys it because ddraw is stored in object, but the caller doesn't know this. I'd be better to explicitly destroy it.
What about render_target in this case? Clipper isn't a problem because you didn't create it - the application did.
+HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, IDirectDraw *ddraw, IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface) ...
- hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &render_target, NULL);
- if (FAILED(hr))
return hr;
Here you have to release clipper (because you addref'ed it) and the primary surface.
You can avoid the clipper release by addrefing it after the CreateSurface call. AddRef never fails.