Fixing possible segfault through using references in signal argument.

Replaced DataContainer::s_dataAdded<const std::string&, DataHandle> with DataContainer::s_dataAdded<std::string, DataHandle>.
parent 44e9af20
...@@ -115,7 +115,7 @@ namespace campvis { ...@@ -115,7 +115,7 @@ namespace campvis {
return _dataContainer; return _dataContainer;
} }
void DataContainerInspectorWidget::onDataContainerDataAdded(const std::string& key, DataHandle dh) { void DataContainerInspectorWidget::onDataContainerDataAdded(std::string key, DataHandle dh) {
// copy QtDataHandle because signal will be handled by a different thread an indefinite amount of time later: // copy QtDataHandle because signal will be handled by a different thread an indefinite amount of time later:
emit dataContainerChanged(QString::fromStdString(key), QtDataHandle(dh)); emit dataContainerChanged(QString::fromStdString(key), QtDataHandle(dh));
} }
......
...@@ -87,7 +87,7 @@ namespace campvis { ...@@ -87,7 +87,7 @@ namespace campvis {
/** /**
* Slot called when _dataContainer has changed and emitted the s_dataAdded signal. * Slot called when _dataContainer has changed and emitted the s_dataAdded signal.
*/ */
void onDataContainerDataAdded(const std::string&, DataHandle); void onDataContainerDataAdded(std::string, DataHandle);
/** /**
* Size hint for the default window size * Size hint for the default window size
......
...@@ -99,7 +99,7 @@ namespace campvis { ...@@ -99,7 +99,7 @@ namespace campvis {
--_ignorePropertyUpdates; --_ignorePropertyUpdates;
} }
void DataNamePropertyWidget::onDataAdded(const std::string& key, DataHandle dh) { void DataNamePropertyWidget::onDataAdded(std::string key, DataHandle dh) {
emit s_dataAddedQt(QString::fromStdString(key), dh); emit s_dataAddedQt(QString::fromStdString(key), dh);
} }
......
...@@ -65,7 +65,7 @@ namespace campvis { ...@@ -65,7 +65,7 @@ namespace campvis {
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty();
void onDataAdded(const std::string& key, DataHandle dh); void onDataAdded(std::string key, DataHandle dh);
private slots: private slots:
void onTextChanged(const QString& text); void onTextChanged(const QString& text);
......
...@@ -146,7 +146,7 @@ namespace campvis { ...@@ -146,7 +146,7 @@ namespace campvis {
* Signal emitted when data has been added to this DataContainer (this includes also data being replaced). * Signal emitted when data has been added to this DataContainer (this includes also data being replaced).
* First parameter is the name of the added data, second parameter contains a DataHandle to the new data. * First parameter is the name of the added data, second parameter contains a DataHandle to the new data.
*/ */
sigslot::signal2<const std::string&, DataHandle> s_dataAdded; sigslot::signal2<std::string, DataHandle> s_dataAdded;
/// Signal emitted when list of DataHandles has changed. /// Signal emitted when list of DataHandles has changed.
sigslot::signal0 s_changed; sigslot::signal0 s_changed;
......
...@@ -252,7 +252,7 @@ namespace campvis { ...@@ -252,7 +252,7 @@ namespace campvis {
#endif #endif
} }
void AbstractPipeline::onDataContainerDataAdded(const std::string& name, DataHandle dh) { void AbstractPipeline::onDataContainerDataAdded(std::string name, DataHandle dh) {
if (name == _renderTargetID.getValue()) { if (name == _renderTargetID.getValue()) {
s_renderTargetChanged.emitSignal(); s_renderTargetChanged.emitSignal();
} }
......
...@@ -207,7 +207,7 @@ namespace campvis { ...@@ -207,7 +207,7 @@ namespace campvis {
* \param name Name of the added data. * \param name Name of the added data.
* \param dh DataHandle to the newly added data. * \param dh DataHandle to the newly added data.
*/ */
virtual void onDataContainerDataAdded(const std::string& name, DataHandle dh); virtual void onDataContainerDataAdded(std::string name, DataHandle dh);
/// Pointer to the DataContainer containing local working set of data for this Pipeline, must not be 0. /// Pointer to the DataContainer containing local working set of data for this Pipeline, must not be 0.
DataContainer* _data; DataContainer* _data;
......
...@@ -127,7 +127,7 @@ namespace campvis { ...@@ -127,7 +127,7 @@ namespace campvis {
} }
} }
void AutoEvaluationPipeline::onDataContainerDataAdded(const std::string& name, DataHandle dh) { void AutoEvaluationPipeline::onDataContainerDataAdded(std::string name, DataHandle dh) {
{ {
// acquire read lock // acquire read lock
tbb::spin_rw_mutex::scoped_lock lock(_pmMutex, false); tbb::spin_rw_mutex::scoped_lock lock(_pmMutex, false);
......
...@@ -86,7 +86,7 @@ namespace campvis { ...@@ -86,7 +86,7 @@ namespace campvis {
* \param name Name of the added data. * \param name Name of the added data.
* \param dh DataHandle to the newly added data. * \param dh DataHandle to the newly added data.
*/ */
virtual void onDataContainerDataAdded(const std::string& name, DataHandle dh); virtual void onDataContainerDataAdded(std::string name, DataHandle dh);
/** /**
* Recursively looks for all DataNameProperties in \a pc and adds them to the port map. * Recursively looks for all DataNameProperties in \a pc and adds them to the port map.
......
...@@ -381,7 +381,7 @@ namespace campvis { ...@@ -381,7 +381,7 @@ namespace campvis {
} }
} }
void MatrixProcessor::DataContainerDataAdded(const std::string& name, DataHandle data) { void MatrixProcessor::DataContainerDataAdded(std::string name, DataHandle data) {
if (p_parserMode.getValue()) { if (p_parserMode.getValue()) {
if (_dataDependencies.find(name) != _dataDependencies.end()) if (_dataDependencies.find(name) != _dataDependencies.end())
invalidate(INVALID_RESULT); invalidate(INVALID_RESULT);
......
...@@ -103,7 +103,7 @@ namespace campvis { ...@@ -103,7 +103,7 @@ namespace campvis {
CameraProperty p_cameraProperty; CameraProperty p_cameraProperty;
void DataContainerDataAdded(const std::string& name, DataHandle data); void DataContainerDataAdded(std::string name, DataHandle data);
protected: protected:
/// \see AbstractProcessor::updateResult() /// \see AbstractProcessor::updateResult()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment