Hi,

I'm trying to use QSqlSocket in my application but when I delete it (manually or not), I got an exception in QSaredData line 165 :
Qt Code:
  1. inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
To copy to clipboard, switch view to plain text mode 

I just wrote a minimal code here :

here is test.h
Qt Code:
  1. #include <QObject>
  2. #include <QtNetwork/QSslSocket>
  3.  
  4. class test : public QObject
  5. {
  6. Q_OBJECT
  7.  
  8. public:
  9. test();
  10. ~test();
  11.  
  12. private:
  13. QSslSocket *socket;
  14. };
To copy to clipboard, switch view to plain text mode 

here is test.cpp
Qt Code:
  1. test::test() :
  2. QObject(NULL)
  3. {
  4. socket = new QSslSocket(this);
  5. }
  6.  
  7. test::~test()
  8. {
  9. delete socket;
  10. // I also try this but don't work too
  11. // socket->deleteLater();
  12. }
To copy to clipboard, switch view to plain text mode 

Here is the main program :
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication application(argc, argv);
  4.  
  5. test t;
  6. }
To copy to clipboard, switch view to plain text mode 

Can you help me please ?

Thank you