Important: Please read the Qt Code of Conduct -

One task QRunnable does not call a destructor

  • using uint64 = unsigned int64_t;
    using cuint64 = const uint64;
    using string = std::string;
    using cstring = const string;
    class SyncTask: public QRunnable
            cstring Information;
            const string& GetMirrorOfDataOnHDD();
            uint QuantityError;
            const VariativeData& Settings;
            virtual void BasicProcedureOfTask(cstring& MirrorOfDataOnHDD) = 0;
            virtual SyncTask* CreateNewTask() = 0;
            cuint64 Key;
            SyncTask(const VariativeData& Settings_,
                     cstring& Information_,
                     uint QuantityError_);
            virtual ~SyncTask();
            void run();
    class CountFile final: public SyncTask
            cstring SubPathToFile;
            std::unordered_map<string, uint16>* const Tickers;
            void GetDataFromTextFile(cstring& FullPathReadFile, Array<allData>& ArrayForTask);
            void WriteFileForTicker(cstring& MirrorOfData, const MyLib::Array<allData>& ArrayOfFile, cstring& CurrentMonth, cuint16 IndexOfTicker);
            void WriteArrayToBinFiles(cstring& MirrorOfData, const Array<allData>& ArrayForTask);
            void BasicProcedureOfTask(cstring& MirrorOfData) override;
            SyncTask* CreateNewTask() override;
            CountFile(const VariativeData& Settings_,
                      cstring& SubPathToFile_,
                      void* const Tickers_ = nullptr,
                      uint QuantityError_ = 0)
                  Tickers((std::unordered_map<string, uint16>*) Tickers_),
                  SyncTask(Settings_, SubPathToFile_, QuantityError_)

    cuint64 Key - a unique value obtained with the help of the std::atomic<uint64>, with which I analyze the call of the destructor for tasks. In multithreaded mode, all tasks are performed, but for one is the destructor not called.

    I think this is mistake of the Qt- library.

Log in to reply