More rearrangement of headers. Replaced delete with delete[] where
appropriate.
This commit is contained in:
@@ -8,6 +8,10 @@
|
|||||||
|
|
||||||
#include "props.hxx"
|
#include "props.hxx"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#if PROPS_STANDALONE
|
#if PROPS_STANDALONE
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -17,7 +21,6 @@ using std::sort;
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
|
|
||||||
@@ -25,9 +28,6 @@ SG_USING_STD(sort);
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
@@ -418,7 +418,7 @@ SGPropertyNode::set_string (const char * val)
|
|||||||
if (_tied) {
|
if (_tied) {
|
||||||
return _value.string_val->setValue(val);
|
return _value.string_val->setValue(val);
|
||||||
} else {
|
} else {
|
||||||
delete (char *)_local_val.string_val;
|
delete [] (char *)_local_val.string_val;
|
||||||
_local_val.string_val = copy_string(val);
|
_local_val.string_val = copy_string(val);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -474,7 +474,7 @@ SGPropertyNode::clear_value ()
|
|||||||
delete _value.string_val;
|
delete _value.string_val;
|
||||||
_value.string_val = 0;
|
_value.string_val = 0;
|
||||||
} else {
|
} else {
|
||||||
delete (char *)_local_val.string_val;
|
delete [] (char *)_local_val.string_val;
|
||||||
}
|
}
|
||||||
_local_val.string_val = 0;
|
_local_val.string_val = 0;
|
||||||
break;
|
break;
|
||||||
@@ -676,7 +676,7 @@ SGPropertyNode::SGPropertyNode (const char * name,
|
|||||||
*/
|
*/
|
||||||
SGPropertyNode::~SGPropertyNode ()
|
SGPropertyNode::~SGPropertyNode ()
|
||||||
{
|
{
|
||||||
delete (char *)_name;
|
delete [] (char *)_name;
|
||||||
for (int i = 0; i < (int)_children.size(); i++) {
|
for (int i = 0; i < (int)_children.size(); i++) {
|
||||||
delete _children[i];
|
delete _children[i];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user