Fix use of uninitialized variable pointed out by valgrind

This commit is contained in:
rdb 2016-03-17 21:39:42 +01:00
parent 844a284925
commit cccd29cc61

View File

@ -27,13 +27,15 @@ Pipeline *Pipeline::_render_pipeline = (Pipeline *)NULL;
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
Pipeline:: Pipeline::
Pipeline(const string &name, int num_stages) : Pipeline(const string &name, int num_stages) :
Namable(name) Namable(name),
#ifdef THREADED_PIPELINE #ifdef THREADED_PIPELINE
, _lock("Pipeline") _num_stages(num_stages),
_lock("Pipeline")
#else
_num_stages(1)
#endif #endif
{ {
#ifdef THREADED_PIPELINE #ifdef THREADED_PIPELINE
// We maintain all of the cyclers in the world on one of two linked // We maintain all of the cyclers in the world on one of two linked
// lists. Cyclers that are "clean", which is to say, they have the // lists. Cyclers that are "clean", which is to say, they have the
// same value across all pipeline stages, are stored on the _clean // same value across all pipeline stages, are stored on the _clean
@ -56,9 +58,15 @@ Pipeline(const string &name, int num_stages) :
// This flag is true only during the call to cycle(). // This flag is true only during the call to cycle().
_cycling = false; _cycling = false;
#else
if (num_stages != 1) {
pipeline_cat.warning()
<< "Requested " << num_stages
<< " pipeline stages but multithreaded render pipelines not enabled in build.\n";
}
#endif // THREADED_PIPELINE #endif // THREADED_PIPELINE
set_num_stages(num_stages); nassertv(num_stages >= 1);
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////