On 28.04.2016 21:17, Aaryaman Vasishta wrote: > + IDirect3DRM_AddRef(texture->d3drm); > + > + if (texture->image) > + return D3DRMERR_BADOBJECT; Doesn't this leak a reference in case of an error? ->initialized is not set to TRUE yet.