View Single Post
Old 12th August 2016, 21:13   #13  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by shekh View Post
&PointFilter() is taking address of a temporary object, which has a const qualifier

I would put this on separate line

PointFilter filter;
return CreateResize( args[0].AsClip(), args[1].AsInt(), args[2].AsInt(),args[7].AsInt(0), &args[3], &filter, env );

but I hope CreateResize does not store that pointer somewhere
Nah, you're passing out an address on stack, &filter is a dangling pointer!
The object is meant to be on the stack of CreateResize, not the stack of the function that calls CreateResize!
feisty2 is offline   Reply With Quote