Add a correct PS name for "times".
Fix coverity report (unchecked return and missing initialization)
Reduce the risk of the files or sockets being closed after the end of 'main' (or more exactly before the library start being unloaded) by calling CloseFiles and ResetGlobals in the destructor of the TApplication (which is in most cases on the stack of the main function)

git-svn-id: http://root.cern.ch/svn/root/trunk@48219 27541ba8-7e3a-0410-8455-c3a389f83636
(cherry picked from commit 84dfc99672b0eaa836d173dc4171dffcc19742ea)
Extend (subvert!) TROOT::CloseFiles to also delete the other active user objects held in TROOT ; for example this allow the earlier deletion of outstanding TBrowsers object, allowing their destructor to use a fully functional interpreter ; this fixes <http://savannah.cern.ch/bugs/?99193>

git-svn-id: http://root.cern.ch/svn/root/trunk@48220 27541ba8-7e3a-0410-8455-c3a389f83636
(cherry picked from commit ae57174d1b1ffba66cbbecfef77ee55365c14127)
Also call TROOT::CloseFiles as a atexit function.  This reduces the risk of problem when ::exit is called explicitly.  However this solution still requires at least one TApplication to be created and since atexit (on linux/macos) are in order, this is still technically too late.  The library that are loaded dynamically (gSystem->Load, dlopen) will be unloaded before the atexit installed by TApplication (at the start of the main).  What we really need is to call exactly after the end of the main and before the first library (with a dictionary) is unloaded [which we could do if (and only if) we know how to cheaply know that the library is being unloaded after main

git-svn-id: http://root.cern.ch/svn/root/trunk@48236 27541ba8-7e3a-0410-8455-c3a389f83636
(cherry picked from commit 0f0289597deefab376512a9986885b1dbeecdbf5)
Add missing header

git-svn-id: http://root.cern.ch/svn/root/trunk@48237 27541ba8-7e3a-0410-8455-c3a389f83636
(cherry picked from commit 8fc631bf874b961a3087fa1105c57b65aafbeb0c)
Remove from closeFiles the deletion that are either too early or inaccurate (fSpecials does not own its content)

git-svn-id: http://root.cern.ch/svn/root/trunk@48248 27541ba8-7e3a-0410-8455-c3a389f83636
(cherry picked from commit 43ed8fa6a1a8eef87948363cfc67c4f192bfbf27)
Introduce EndOfProcessCleanups rather than subverting CloseFiles.

This allows to separate the end of process action from just
closing the files (used by pyroot).

See commit ae57174d1b1ffba66cbbecfef77ee55365c14127
Fix order of deletion TROOT destructor and EndOfProcessCleanups.

Some objects (TParallelCoord) manipulate global objects (TStyles)
in their destructor.  Reorder the deletion of the global object
to avoid conflicts.
Fix buffer size extension in TBasket::LoadBasketBuffers

We need to not only resize in write mode but also
check the size in write mode (as the extra space is
counted or not in BufferSize depending on the
read/write mode).
fix bug in analytical integrals over RooHistPdf sub-ranges

- fixed typo: frcode |= ... instead of frcode = ...
- reactivate old behaviour that permits analytical integrations for
  interpolated RooHistPdfs, if the integration range is the full range
  of all the integration variable(s)
- fix a bug with multidimensional integrals (my code was a bit too
  clever)

Signed-off-by: Wouter Verkerke <verkerke@nikhef.nl>
RooRandom: add interface to set RNG, use TRandom::RndmArray for greater speed

Signed-off-by: Wouter Verkerke <verkerke@nikhef.nl>
fixed problem with deleting the training sample right after train, when using OptimizeConfigparameters AND introduced boost stopping if error rate > 0.5
Introduce EndOfProcessCleanups rather than subverting CloseFiles

Apply the same modifications than in TUnixSystem, preventing a crash when selecting "Quit ROOT" from the menu of a TCanvas
Removed the need of -std=cxx11 when building with cocoa (CMake)
Add freetype to build GCocoa
Replace [] with 'objectAtIndex'.
fix compiler warning
fix typo
Fix tear down issues [when libNet is loaded after TROOT is built].

On Ubuntu the linker strips the unused libraries.  Eventhough stressHistogram
is explicitly linked against libNet, it is not retained and thus is loaded only
as needed in the middle part of the execution.   Concretely this also means
that it is loaded *after* the construction of the TApplication object and thus
after the registration (atexit) of the EndOfProcessCleanups routine.
Consequently, after the end of main, libNet is unloaded before
EndOfProcessCleanups is called.   When EndOfProcessCleanups is executed it
indirectly needs the TClass for TSocket and its search will use resources that
have already been unloaded (technically the function static in TUnixSystem's
DynamicPath and the dictionary from libNet).

Similarly, the ordering (before this commit) was broken in the following case:

   TApplication creation (EndOfProcessCleanups registration)
   load UserLibrary
   create TFile
   Append UserObject to TFile

and after the end of main the order of execution was

   unload UserLibrary
   call EndOfProcessCleanups
      Write the TFile
        attempt to write the user object.
   ....

where what we need is to have the files closen/written before the unloading of
the library.

To solve the problem we now register an atexit function for every dictionary
thus making sure there is at least one executed before the first library tear
down after main.

If atexit is called directly within a library's code, the function will called
*either* when the library is 'dlclose'd or after then end of main (whichever
comes first).   We do *not* want the files to be closed whenever a library is
unloaded via dlclose.  To avoid this, we add the function (CallCloseFiles) from
the dictionary indirectly (via ROOT::RegisterModule).  In this case the
function will only be called either when libCore is 'dlclose'd or right after
the end of main.

This fixes ROOT-5620.