Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooSentinel.cxx
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*****************************************************************************
4 * Project: RooFit *
5 * Package: RooFitCore *
6 * @(#)root/roofitcore:$Id$
7 * Authors: *
8 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
9 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
10 * *
11 * Copyright (c) 2000-2005, Regents of the University of California *
12 * and Stanford University. All rights reserved. *
13 * *
14 * Redistribution and use in source and binary forms, *
15 * with or without modification, are permitted according to the terms *
16 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
17 *****************************************************************************/
18
19/**
20\file RooSentinel.cxx
21\class RooSentinel
22\ingroup Roofitcore
23
24RooSentinel is a special purpose singleton class that terminates
25all other RooFit singleton services when the process exits.
26
27All function RooFit singleton services are created on the heap with
28a static wrapper function to avoid the 'static initialization order fiasco'
29but are not automatically destroyed at the end of the session. This class
30installs an atexit() function that takes care of this
31**/
32
33#include "RooSentinel.h"
34#include "RooArgSet.h"
35#include "RooRealConstant.h"
36#include "RooResolutionModel.h"
38#include "RooDataSet.h"
39
40bool RooSentinel::_active = false ;
41
42static void CleanUpRooFitAtExit()
43{
44 // Clean up function called at program termination before global objects go out of scope.
48}
49
50
51
52////////////////////////////////////////////////////////////////////////////////
53/// Install atexit handler that calls CleanupRooFitAtExit()
54/// on program termination
55
56void RooSentinel::activate()
57{
58 if (!_active) {
59 _active = true ;
60 atexit(CleanUpRooFitAtExit) ;
61 }
62}
63
64/// \endcond
static void cleanup()
Definition RooArgSet.cxx:80
static void cleanup()
static void cleanup()
Explicitly deletes the shared properties list on exit to avoid problems with the initialization order...