diff --git a/lang/csharp/Continental/eCAL/Protobuf/ProtoSubscriber.cs b/lang/csharp/Continental/eCAL/Protobuf/ProtoSubscriber.cs index 11ce3670f0..7e0b9f1387 100644 --- a/lang/csharp/Continental/eCAL/Protobuf/ProtoSubscriber.cs +++ b/lang/csharp/Continental/eCAL/Protobuf/ProtoSubscriber.cs @@ -33,8 +33,6 @@ public ReceiveCallbackData() } }; - private ReceiveCallbackData receivedData; - /** * @brief Signature for a data callback. **/ @@ -50,7 +48,6 @@ public ProtobufSubscriber(string topicName) { T msg = new T(); binarySubscriber = new Subscriber(topicName, Common.ProtobufHelper.GetProtoMessageTypeName(msg), Common.ProtobufHelper.GetProtoMessageDescription(msg)); - receivedData = new ReceiveCallbackData(); } /** @@ -83,6 +80,7 @@ private void callBack(String topic, Core.Subscriber.ReceiveCallbackData data) byte[] messageBytes = Encoding.Default.GetBytes(data.data); MemoryStream msgStream = new MemoryStream(messageBytes); + var receivedData = new ReceiveCallbackData(); receivedData.data.MergeFrom(msgStream); receivedData.id = data.id; receivedData.clock = data.clock;