From: jean-pierre roux Date: Fri, 13 Mar 2009 13:54:08 +0000 (+0000) Subject: Avoid message 'taking address of temporary' X-Git-Tag: EED.02Oct2009~120 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=71661cb47994661029f26fddecb025d2a2dd4c72;p=creaMaracasVisu.git Avoid message 'taking address of temporary' --- diff --git a/bbtk/src/bbmaracasvisuPlotterView.cxx b/bbtk/src/bbmaracasvisuPlotterView.cxx index cee80ab..51f36eb 100644 --- a/bbtk/src/bbmaracasvisuPlotterView.cxx +++ b/bbtk/src/bbmaracasvisuPlotterView.cxx @@ -19,15 +19,21 @@ void PlotterView::Process() //--------------------------------------------------- void PlotterView::CreateWidget(wxWindow* parent) { - bbtkDebugMessageInc("Core",9,"PlotterView::CreateWxWindow()"<AddLayer(new pPlotterScaleX()); - mwxwidget->AddLayer(new pPlotterScaleY()); - pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &(bbGetInputInX()), &(bbGetInputInY()) ); // taking address of temporary ! JPRx - - mwxwidget->addFunction(pGF); - bbtkDebugDecTab("Core",9); - bbSetOutputWidget( mwxwidget ); + bbtkDebugMessageInc("Core",9,"PlotterView::CreateWxWindow()"<AddLayer(new pPlotterScaleX()); + mwxwidget->AddLayer(new pPlotterScaleY()); + + // avoid 'taking address of temporary ' + //pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &(bbGetInputInX()), &(bbGetInputInY()) ); // taking address of temporary ! JPRx + std::vector inX = bbGetInputInX(); + std::vector inY = bbGetInputInY(); + + pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &inX, &inY ); + mwxwidget->addFunction(pGF); + bbtkDebugDecTab("Core",9); + bbSetOutputWidget( mwxwidget ); } //--------------------------------------------------- diff --git a/bbtk/src/bbmaracasvisuViewerNV.cxx b/bbtk/src/bbmaracasvisuViewerNV.cxx index c31cbda..8208643 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.cxx +++ b/bbtk/src/bbmaracasvisuViewerNV.cxx @@ -86,10 +86,10 @@ void ViewerNV::Process() //------------------------------------------------------------- void ViewerNV::CreateWidget(wxWindow* parent) { - bbtkDebugMessageInc("Core",9,"ViewerNV::CreateWidget()"<