Browse Source

Make ProtobufObjectPrivate singleton

Alexey Edelev 5 years ago
parent
commit
4f2f6b31b5
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/protobuf/qprotobufobject_p.h

+ 3 - 2
src/protobuf/qprotobufobject_p.h

@@ -55,6 +55,9 @@ struct make_unsigned<int64> { typedef typename std::make_unsigned<decltype(int64
 
 class ProtobufObjectPrivate
 {
+    ProtobufObjectPrivate() = delete;
+    ~ProtobufObjectPrivate() = delete;
+    Q_DISABLE_COPY(ProtobufObjectPrivate)
 public:
     using Serializer = std::function<QByteArray(const QVariant &, int &)>;
     using Deserializer = std::function<void(SelfcheckIterator &, QVariant &)>;
@@ -66,8 +69,6 @@ public:
     using SerializerRegistry = std::unordered_map<int/*metatypeid*/, SerializationHandlers>;
     static SerializerRegistry serializers;
 
-    ProtobufObjectPrivate() {}
-
     static void registerSerializers();
 
     template <typename T,