Index: osgVisual/src/dataIO/visual_dataIO.cpp
===================================================================
--- osgVisual/src/dataIO/visual_dataIO.cpp	(revision 116)
+++ osgVisual/src/dataIO/visual_dataIO.cpp	(revision 118)
@@ -191,12 +191,9 @@
 	{
 		// Check if this variable name&-type already exists
-		if( dataSlots[i].variableName == variableName_ && dataSlots[i].direction == direction_  && dataSlots[i].variableType ==  variableTyp_)
+		if( dataSlots[i]->variableName == variableName_ && dataSlots[i]->direction == direction_  && dataSlots[i]->variableType ==  variableTyp_)
 		{
 			//OSG_NOTIFY( osg::INFO ) << "visual_dataIO::getSlotPointer() - Slot found at position " << i << std::endl;
 			// Return pointer to the value
-			if (variableTyp_ == osgVisual::dataIO_slot::STRING )
-				return &(dataSlots[i].sValue);
-			else
-				return &(dataSlots[i].value);
+			return dataSlots[i];
 		}
 	}
@@ -204,16 +201,11 @@
 	// Slot does not exist -> add it to slot list
 	//OSG_NOTIFY( osg::INFO ) << "visual_dataIO::getSlotPointer() - Slot not found, will add as new slot " << std::endl;
-	dataIO_slot newSlot;
-	newSlot.variableName = variableName_;
-	newSlot.variableType = variableTyp_;
-	newSlot.value = 0;
-	newSlot.sValue = "";
+	dataIO_slot* newSlot = new dataIO_slot();
+	newSlot->variableName = variableName_;
+	newSlot->variableType = variableTyp_;
+	newSlot->value = 0;
+	newSlot->sValue = "";
 	dataSlots.push_back( newSlot );
-	if (variableTyp_ == osgVisual::dataIO_slot::STRING )
-		return &(dataSlots.back().sValue);
-	else
-	{
-		return &(dataSlots.back().value);
-	}
+	return dataSlots.back();
 }
 
@@ -224,8 +216,8 @@
 	{
 		// Check if this variable name&-type already exists
-		if( dataSlots[i].variableName == variableName_ && dataSlots[i].direction == direction_  && dataSlots[i].variableType == osgVisual::dataIO_slot::DOUBLE )
+		if( dataSlots[i]->variableName == variableName_ && dataSlots[i]->direction == direction_  && dataSlots[i]->variableType == osgVisual::dataIO_slot::DOUBLE )
 		{
 			//OSG_NOTIFY( osg::INFO ) << "visual_dataIO::getSlotDataAsDouble() - Slot found at position " << i << std::endl;
-			return dataSlots[i].value;
+			return dataSlots[i]->value;
 		}
 	}
@@ -239,8 +231,8 @@
 	{
 		// Check if this variable name&-type already exists
-		if( dataSlots[i].variableName == variableName_ && dataSlots[i].direction == direction_  && dataSlots[i].variableType == osgVisual::dataIO_slot::STRING )
+		if( dataSlots[i]->variableName == variableName_ && dataSlots[i]->direction == direction_  && dataSlots[i]->variableType == osgVisual::dataIO_slot::STRING )
 		{
 			//OSG_NOTIFY( osg::INFO ) << "visual_dataIO::getSlotDataAsDouble() - Slot found at position " << i << std::endl;
-			return dataSlots[i].sValue;
+			return dataSlots[i]->sValue;
 		}
 	}
@@ -255,10 +247,10 @@
 	{
 		// Check if this variable name&-type already exists
-		if( dataSlots[i].variableName == variableName_ && dataSlots[i].direction == direction_ && dataSlots[i].variableType ==  osgVisual::dataIO_slot::STRING)
+		if( dataSlots[i]->variableName == variableName_ && dataSlots[i]->direction == direction_ && dataSlots[i]->variableType ==  osgVisual::dataIO_slot::STRING)
 		{
 			// Update value
-			dataSlots[i].sValue = sValue_;
+			dataSlots[i]->sValue = sValue_;
 			slotFound = true;
-			return &(dataSlots[i]);
+			return dataSlots[i];
 		}
 		
@@ -268,11 +260,12 @@
 	{
 		// Slot does not exist -> add it to slot list
-		dataIO_slot newSlot;
-		newSlot.variableName = variableName_;
-		newSlot.direction = direction_;
-		newSlot.variableType = osgVisual::dataIO_slot::STRING;
-		newSlot.value = 0;
-		newSlot.sValue = sValue_;
+		dataIO_slot* newSlot = new dataIO_slot();
+		newSlot->variableName = variableName_;
+		newSlot->direction = direction_;
+		newSlot->variableType = osgVisual::dataIO_slot::STRING;
+		newSlot->value = 0;
+		newSlot->sValue = sValue_;
 		dataSlots.push_back( newSlot );
+		return dataSlots.back();
 	}
 
@@ -287,11 +280,11 @@
 	{
 		// Check if this variableName & -type already exists
-		if( dataSlots[i].variableName == variableName_ && dataSlots[i].direction == direction_ && dataSlots[i].variableType ==  osgVisual::dataIO_slot::DOUBLE)
+		if( dataSlots[i]->variableName == variableName_ && dataSlots[i]->direction == direction_ && dataSlots[i]->variableType ==  osgVisual::dataIO_slot::DOUBLE)
 		{
 			// Update value
 			//OSG_NOTIFY( osg::ALWAYS ) << "setSlotData: " << variableName_ << " - value: " << value_ << std::endl;
-			dataSlots[i].value = value_;
+			dataSlots[i]->value = value_;
 			slotFound = true;
-			return &(dataSlots[i]);
+			return dataSlots[i];
 		}	
 	}
@@ -300,11 +293,12 @@
 	{
 		// Slot does not exist -> add it to slot list
-		dataIO_slot newSlot;
-		newSlot.variableName = variableName_;
-		newSlot.direction = direction_;
-		newSlot.variableType = osgVisual::dataIO_slot::DOUBLE;
-		newSlot.value = value_;
-		newSlot.sValue = "";
+		dataIO_slot* newSlot = new dataIO_slot();
+		newSlot->variableName = variableName_;
+		newSlot->direction = direction_;
+		newSlot->variableType = osgVisual::dataIO_slot::DOUBLE;
+		newSlot->value = value_;
+		newSlot->sValue = "";
 		dataSlots.push_back( newSlot );
+		return dataSlots.back();
 	}
 
