On 4/9/2017 1:35 AM, Dukc wrote:
object aMemoryLeak;

void someFunc()
{   throw (aMemoryLeak = new Exception("hello world!"));
}

Would the compiler warn about this or make the exception normally garbage
collected?

That would be a regular gc allocated Exception.


I'm not sure, but perhaps an entirely different syntax would be in place for
throwing a refcounted object, so there's no special casing. For example, could a
throw statement without the new keyword mean a refcounted throw?

Didn't want to do a new syntax.

Reply via email to