GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » FinishTask() funktion for uninitialized Tasks -> Bug or feature?
Re: FinishTask() funktion for uninitialized Tasks -> Bug or feature? [message #20162 is a reply to message #20152] Wed, 18 January 2017 16:51 Go to previous messageGo to previous message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
Hi,
a good praxis (or maybe THE praxis) is to initialize the variables in the constructor, and not in the Init function:

PndStuff::PndStuff() : PndFather(), a(0), b(0), object() {}


In this way also the compiler helps you to find what is missing. Variables should be never left uninitialized. Once you have them initialized, in the Init you can set the proper values, or leave them as they are, and you won't have problems in the FinishTask.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PandaRoot Feb17
Next Topic: Preparations Release 02/17
Goto Forum:
  


Current Time: Thu Mar 28 22:00:39 CET 2024

Total time taken to generate the page: 0.00680 seconds