potential fix of event handler crash in non-muSR fit

This commit is contained in:
nemu 2010-10-27 19:00:47 +00:00
parent 98076c5cf9
commit e191844270
2 changed files with 9 additions and 0 deletions

View File

@ -3048,6 +3048,9 @@ void PMusrCanvas::PlotData(Bool_t unzoom)
xmax = fXmax; xmax = fXmax;
} }
// tell the canvas that the selected object (the one under the mouse pointer) is not your object, before to actually delete it.
fMainCanvas->SetSelected(fMainCanvas->GetPadSave());
// cleanup if previous fMultiGraphData is present // cleanup if previous fMultiGraphData is present
if (fMultiGraphData) { if (fMultiGraphData) {
delete fMultiGraphData; delete fMultiGraphData;
@ -3275,6 +3278,9 @@ void PMusrCanvas::PlotDifference(Bool_t unzoom)
xmax = fXmax; xmax = fXmax;
} }
// tell the canvas that the selected object (the one under the mouse pointer) is not your object, before to actually delete it.
fMainCanvas->SetSelected(fMainCanvas->GetPadSave());
// clean up previous fMultiGraphDiff // clean up previous fMultiGraphDiff
if (fMultiGraphDiff) { if (fMultiGraphDiff) {
delete fMultiGraphDiff; delete fMultiGraphDiff;

View File

@ -120,6 +120,9 @@ void PEventHandlerTest::SwitchGraph()
{ {
Double_t xmin, xmax; Double_t xmin, xmax;
// tell the canvas that the selected object (the one under the mouse pointer) is not your object, before to actually delete it.
fMainCanvas->SetSelected(fMainCanvas->GetPadSave());
if (fSwitched) { if (fSwitched) {
xmin = fMultiGraph1->GetXaxis()->GetBinCenter(fMultiGraph1->GetXaxis()->GetFirst()); xmin = fMultiGraph1->GetXaxis()->GetBinCenter(fMultiGraph1->GetXaxis()->GetFirst());
xmax = fMultiGraph1->GetXaxis()->GetBinCenter(fMultiGraph1->GetXaxis()->GetLast()); xmax = fMultiGraph1->GetXaxis()->GetBinCenter(fMultiGraph1->GetXaxis()->GetLast());