Time prefs: Set pointer NULL, delete in destructor
... avoiding potential memory leak.
This commit is contained in:
parent
f325986993
commit
15cc2a1fad
|
@ -269,6 +269,14 @@ NetworkTimeView::NetworkTimeView(const char* name)
|
|||
:
|
||||
BGroupView(name, B_VERTICAL, B_USE_DEFAULT_SPACING),
|
||||
fSettings(),
|
||||
fServerTextControl(NULL),
|
||||
fAddButton(NULL),
|
||||
fRemoveButton(NULL),
|
||||
fResetButton(NULL),
|
||||
fServerListView(NULL),
|
||||
fTryAllServersCheckBox(NULL),
|
||||
fSynchronizeAtBootCheckBox(NULL),
|
||||
fSynchronizeButton(NULL),
|
||||
fUpdateThread(-1)
|
||||
{
|
||||
fSettings.Load();
|
||||
|
@ -276,6 +284,19 @@ NetworkTimeView::NetworkTimeView(const char* name)
|
|||
}
|
||||
|
||||
|
||||
NetworkTimeView::~NetworkTimeView()
|
||||
{
|
||||
delete fServerTextControl;
|
||||
delete fAddButton;
|
||||
delete fRemoveButton;
|
||||
delete fResetButton;
|
||||
delete fServerListView;
|
||||
delete fTryAllServersCheckBox;
|
||||
delete fSynchronizeAtBootCheckBox;
|
||||
delete fSynchronizeButton;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
NetworkTimeView::MessageReceived(BMessage* message)
|
||||
{
|
||||
|
|
|
@ -84,6 +84,7 @@ private:
|
|||
class NetworkTimeView : public BGroupView {
|
||||
public:
|
||||
NetworkTimeView(const char* name);
|
||||
virtual ~NetworkTimeView();
|
||||
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
virtual void AttachedToWindow();
|
||||
|
|
Loading…
Reference in New Issue