Skip to content

Commit

Permalink
[SceneUtility] Initialize pointer to nullptr (#4712)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxbilger committed May 3, 2024
1 parent 86505ac commit 8c20a9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Expand Up @@ -115,9 +115,11 @@ FileMessageHandlerComponent::FileMessageHandlerComponent() :

FileMessageHandlerComponent::~FileMessageHandlerComponent()
{
MessageDispatcher::rmHandler(m_handler) ;

delete m_handler ;
if (m_handler)
{
MessageDispatcher::rmHandler(m_handler) ;
delete m_handler ;
}
}

void FileMessageHandlerComponent::parse ( core::objectmodel::BaseObjectDescription* arg )
Expand Down
Expand Up @@ -77,7 +77,7 @@ class SOFA_COMPONENT_SCENEUTILITY_API FileMessageHandlerComponent : public core:
void parse ( core::objectmodel::BaseObjectDescription* arg ) override;

Data<std::string> d_filename ; ///< Name of the file into which the message will be saved in.
helper::logging::MessageHandler* m_handler ;
helper::logging::MessageHandler* m_handler { nullptr };


bool m_isValid ;
Expand Down

0 comments on commit 8c20a9b

Please sign in to comment.