aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/param.cpp3
-rw-r--r--src/param.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/param.cpp b/src/param.cpp
index c5f60c6..f96e9c3 100644
--- a/src/param.cpp
+++ b/src/param.cpp
@@ -107,7 +107,8 @@ PARAM::PARAM(void)
time_UtZ(0.0), time_opt(0.0), time_Omega(0.0) {}
PARAM::~PARAM() {
- gsl_rng_free(gsl_r);
+ if (gsl_r)
+ gsl_rng_free(gsl_r);
}
// Read files: obtain ns_total, ng_total, ns_test, ni_test.
diff --git a/src/param.h b/src/param.h
index eb2cef7..e747182 100644
--- a/src/param.h
+++ b/src/param.h
@@ -213,7 +213,7 @@ public:
size_t n_mh; // # MH steps in each iter.
double geo_mean; // Mean of geometric dist.
long int randseed; // holds -seed parameter
- gsl_rng *gsl_r; // Track the randomizer
+ gsl_rng *gsl_r = NULL; // Track the randomizer
double trace_G;
HYPBSLMM cHyp_initial;