mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 14:31:42 +00:00
Move NL implementation pointers to unique_ptr
This commit is contained in:
parent
768a9c89aa
commit
359529d616
eeschema/navlib
pcbnew/navlib
@ -30,15 +30,13 @@ NL_SCHEMATIC_PLUGIN::NL_SCHEMATIC_PLUGIN() : m_impl( nullptr )
|
||||
if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver
|
||||
&& KIPLATFORM::DRIVERS::Valid3DConnexionDriverVersion() )
|
||||
{
|
||||
m_impl = new NL_SCHEMATIC_PLUGIN_IMPL();
|
||||
m_impl = std::make_unique<NL_SCHEMATIC_PLUGIN_IMPL>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NL_SCHEMATIC_PLUGIN::~NL_SCHEMATIC_PLUGIN()
|
||||
{
|
||||
delete m_impl;
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
void NL_SCHEMATIC_PLUGIN::SetFocus( bool focus )
|
||||
|
@ -26,6 +26,8 @@
|
||||
#ifndef NL_SCHEMATIC_PLUGIN_H_
|
||||
#define NL_SCHEMATIC_PLUGIN_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
// Forward declarations.
|
||||
class EDA_DRAW_PANEL_GAL;
|
||||
class NL_SCHEMATIC_PLUGIN_IMPL;
|
||||
@ -61,7 +63,7 @@ public:
|
||||
void SetFocus( bool aFocus );
|
||||
|
||||
private:
|
||||
NL_SCHEMATIC_PLUGIN_IMPL* m_impl;
|
||||
std::unique_ptr<NL_SCHEMATIC_PLUGIN_IMPL> m_impl;
|
||||
};
|
||||
|
||||
#endif // NL_SCHEMATIC_PLUGIN_H_
|
||||
|
@ -28,15 +28,13 @@ NL_PCBNEW_PLUGIN::NL_PCBNEW_PLUGIN( PCB_DRAW_PANEL_GAL* aViewport ) : m_impl( nu
|
||||
if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver
|
||||
&& KIPLATFORM::DRIVERS::Valid3DConnexionDriverVersion() )
|
||||
{
|
||||
m_impl = new NL_PCBNEW_PLUGIN_IMPL( aViewport );
|
||||
m_impl = std::make_unique<NL_PCBNEW_PLUGIN_IMPL>( aViewport );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NL_PCBNEW_PLUGIN::~NL_PCBNEW_PLUGIN()
|
||||
{
|
||||
delete m_impl;
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
void NL_PCBNEW_PLUGIN::SetFocus( bool focus )
|
||||
|
@ -26,6 +26,8 @@
|
||||
#ifndef NL_PCBNEW_PLUGIN_H_
|
||||
#define NL_PCBNEW_PLUGIN_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
// Forward declarations.
|
||||
class PCB_DRAW_PANEL_GAL;
|
||||
class NL_PCBNEW_PLUGIN_IMPL;
|
||||
@ -54,7 +56,7 @@ public:
|
||||
void SetFocus( bool aFocus );
|
||||
|
||||
private:
|
||||
NL_PCBNEW_PLUGIN_IMPL* m_impl;
|
||||
std::unique_ptr<NL_PCBNEW_PLUGIN_IMPL> m_impl;
|
||||
};
|
||||
|
||||
#endif // NL_PCBNEW_PLUGIN_H_
|
||||
|
Loading…
Reference in New Issue
Block a user