Merged in segfault (pull request #15)
fix segfault Approved-by: Andreas Suter
This commit is contained in:
commit
1845b5c176
@ -1437,19 +1437,18 @@ Int_t main(Int_t argc, Char_t *argv[])
|
|||||||
musrFT_dumpData(startupParam.dumpFln, fourier, startupParam.fourierRange[0], startupParam.fourierRange[1]);
|
musrFT_dumpData(startupParam.dumpFln, fourier, startupParam.fourierRange[0], startupParam.fourierRange[1]);
|
||||||
} else { // do Canvas
|
} else { // do Canvas
|
||||||
|
|
||||||
// if Fourier graphical export is whished, switch to batch mode
|
// if Fourier graphical export is wished, switch to batch mode
|
||||||
Bool_t batch = false;
|
Bool_t batch = false;
|
||||||
int cc=0;
|
// create list of essential arguments to pass to the ROOT application
|
||||||
char **arg;
|
std::vector<char*> args;
|
||||||
|
args.push_back(argv[0]); // program name
|
||||||
if (startupParam.graphicFormat.Length() != 0) {
|
if (startupParam.graphicFormat.Length() != 0) {
|
||||||
batch = true;
|
batch = true;
|
||||||
arg[cc] = (Char_t*)malloc(16*sizeof(Char_t));
|
args.push_back((char*)"-b"); // batch mode flag
|
||||||
strcpy(arg[cc], "-b");
|
|
||||||
cc++;
|
|
||||||
}
|
}
|
||||||
|
int cc = args.size();
|
||||||
// plot the Fourier transform
|
// plot the Fourier transform
|
||||||
TApplication app("App", &cc, arg);
|
TApplication app("App", &cc, args.data());
|
||||||
|
|
||||||
if (startupHandler) {
|
if (startupHandler) {
|
||||||
fourierCanvas = std::unique_ptr<PFourierCanvas>(new PFourierCanvas(fourier, dataSetTag, startupParam.title.Data(),
|
fourierCanvas = std::unique_ptr<PFourierCanvas>(new PFourierCanvas(fourier, dataSetTag, startupParam.title.Data(),
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <TApplication.h>
|
#include <TApplication.h>
|
||||||
#include <TSAXParser.h>
|
#include <TSAXParser.h>
|
||||||
@ -301,15 +302,15 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result == PMUSR_SUCCESS) {
|
if (result == PMUSR_SUCCESS) {
|
||||||
// generate Root application needed for PMusrCanvas
|
// create the ROOT application needed for PMusrCanvas
|
||||||
int cc=0;
|
// and pass it only essential arguments
|
||||||
char **arg;
|
std::vector<char*> args;
|
||||||
|
args.push_back(argv[0]); // program name
|
||||||
if (graphicsOutput || asciiOutput) {
|
if (graphicsOutput || asciiOutput) {
|
||||||
arg[cc] = (char*)malloc(16*sizeof(char));
|
args.push_back((char*)"-b"); // batch mode flag
|
||||||
strcpy(arg[cc], "-b");
|
|
||||||
cc++;
|
|
||||||
}
|
}
|
||||||
TApplication app("App", &cc, arg);
|
int cc = args.size();
|
||||||
|
TApplication app("App", &cc, args.data());
|
||||||
|
|
||||||
std::vector<PMusrCanvas*> canvasVector;
|
std::vector<PMusrCanvas*> canvasVector;
|
||||||
PMusrCanvas *musrCanvas;
|
PMusrCanvas *musrCanvas;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user