Closed psteinb closed 8 years ago
true, but I am not sure atm. I actually have relied on RAII in the first place (history).
There were troubles with proper teardowns after an exception occurred, so I became too cautious and wrote the try-catch scope ensuring to destroy() after an exception, since the clients destructor can be missing, and the method destroy() is already there anyway...
And if the client has more work to cleanup, then he still can do that.
Otherwise, it is common to use RAII and we can advise the clients to follow this.
At the moment the TFFT instance is created out of try-catch scope. Making the catch-branch naked, I wont need the try-catch anymore, because: BenchmarkExecutor
is the only caller and has the required try-catch statement needed for proper teardown of the objects.
I think, I will change this to RAII again.
Thanks for your good eye! :-)
closed as it is resolved.
fft.hpp requires TFFT to have the
destroy
method. Why not use RAII here?the try/catch clause ensures that the destructor of TFFT is called, so there should be no explicit destroy to be called. I understand the you require the destroy method in order to time the plan destruction (which I endorse), but the destroy method should not be needed in the catch phrase.