check if config update model is same as the map surfacetype#44
check if config update model is same as the map surfacetype#44haider8645 wants to merge 2 commits intoenvire:masterfrom
Conversation
|
The assert() calls are getting removed by the compiler in cmake Release builds (optoimizes), i'd rather throw an exception |
|
@planthaber added an exception. There is a slight issue with the exception thrown in the constructor and it is that the destructor is not called. If someone creates a map inside a try block and catches this exception, would it result in a memory leak? For my usecase in the MLSMapSlopeLoader this exception is not caught and the program just ends. |
When a constructor throws, the destructor of the base class and of all member variables is still called (basically everything which is constructed before the body of the throwing constructor is executed gets destructed), so there should not be any memory leaks here. However, I think you need to surround the log message and the throw with an |
Hello @planthaber
it was not being checked whether the map updatemodel from the 'maps/grid/MLSConfig' is the same as the SurfaceType in MLSMap.
Either we add this assert from the PR or we can remove the updateModel from the 'maps/grid/MLSConfig' because it is currently unused
Best,
Haider