Removed un-needed null pointer checks in DPX code. Ref #16

This commit is contained in:
John M. Penn 2016-11-02 15:34:06 -05:00
parent 1f75034da2
commit 0a19eeb602
5 changed files with 13 additions and 13 deletions

View File

@ -22,7 +22,7 @@ GPViewProductNode::~GPViewProductNode() {
n = (int)page_node_list.size(); n = (int)page_node_list.size();
for (i=0 ; i<n; i++ ) { for (i=0 ; i<n; i++ ) {
page_view_node = page_node_list[i]; page_view_node = page_node_list[i];
if (page_view_node) { delete page_view_node; } delete page_view_node;
} }
} }

View File

@ -169,10 +169,10 @@ DPC_delta_curve::DPC_delta_curve( DPM_curve* Curve_spec,
DPC_delta_curve::~DPC_delta_curve() { DPC_delta_curve::~DPC_delta_curve() {
// We ONLY delete what we create. // We ONLY delete what we create.
if ( delta_x_var ) { delete delta_x_var; }; delete delta_x_var;
if ( delta_y_var ) { delete delta_y_var; }; delete delta_y_var;
if ( ds[0] ) { delete ds[0]; }; delete ds[0];
if ( ds[1] ) { delete ds[1]; }; delete ds[1];
if ( x_actual_units ) { free( x_actual_units); } if ( x_actual_units ) { free( x_actual_units); }
if ( y_actual_units ) { free( y_actual_units); } if ( y_actual_units ) { free( y_actual_units); }
if ( run_dir1 ) { free( run_dir1); } if ( run_dir1 ) { free( run_dir1); }

View File

@ -125,17 +125,17 @@ DPC_product::~DPC_product() {
int n_pages, pagix; int n_pages, pagix;
int n_tables, tabix; int n_tables, tabix;
if (product_spec) { delete product_spec; } delete product_spec;
if (datastream_supplier) { delete datastream_supplier; } delete datastream_supplier;
n_pages = (int)page_list.size(); n_pages = (int)page_list.size();
for (pagix = 0 ; pagix < n_pages ; pagix ++) { for (pagix = 0 ; pagix < n_pages ; pagix ++) {
page = page_list[pagix]; page = page_list[pagix];
if (page) { delete page; } delete page;
} }
n_tables = (int)table_list.size(); n_tables = (int)table_list.size();
for (tabix = 0 ; tabix < n_tables ; tabix ++) { for (tabix = 0 ; tabix < n_tables ; tabix ++) {
table = table_list[tabix]; table = table_list[tabix];
if (table) { delete table; } delete table;
} }
} }

View File

@ -69,7 +69,7 @@ DPM_column::DPM_column(DPM_component *Parent, xmlNode *Base_node) throw (std::i
DPM_column::~DPM_column() { DPM_column::~DPM_column() {
if (unitspec) { free (unitspec); } if (unitspec) { free (unitspec); }
if (label) { free (label); } if (label) { free (label); }
if (column_var) { delete column_var ; } delete column_var ;
} }
// MEMBER FUNCTION // MEMBER FUNCTION

View File

@ -103,9 +103,9 @@ DPM_relation::DPM_relation(DPM_component *Parent, xmlNode *Base_node) throw (st
// MEMBER FUNCTION // MEMBER FUNCTION
DPM_relation::~DPM_relation() { DPM_relation::~DPM_relation() {
if (xaxis) { delete xaxis; } delete xaxis;
if (yaxis) { delete yaxis; } delete yaxis;
if (zaxis) { delete zaxis; } delete zaxis;
if (title) { free( title); } if (title) { free( title); }
// destroy each of the curves in the curves list // destroy each of the curves in the curves list
int i; int i;