On Thu, Jul 28, 2016 at 12:53 AM, Henri Verbeet <hverbeet(a)gmail.com> wrote:
On 27 July 2016 at 21:09, Aaryaman Vasishta <jem456.vasishta(a)gmail.com> wrote:
On Thu, Jul 28, 2016 at 12:13 AM, Stefan Dösinger
+ if (material) + IDirect3DMaterial_Release(material); This will destroy the material, viewport::SetBackground doesn't addref it.
Right, henri suggested the same. I'll move this outside the cleanup label. I did say the sequence was odd, but it does work because "material" is set to NULL on successful viewport initialisation. On the other hand, I just noticed you'll also leak the material if IDirect3DViewport_SetBackground() fails.
Right, sorry to not mention about the sequence. I also noticed the leak while fixing the same. Cheers, Aaryaman