Assume this piece of C++ code:
class myexception1
{
public:
myexception1()
{};
};
class myexception2
{
public:
myexception2()
{
throw myexception1();
};
};
void test()
{
try
{
throw myexception2();
}
catch (...)
{
}
};
If I run the test
function, which kind of exception will receive the catch block? Could this generate some memory leak because throwing an exception from an exception constructor?