Problem about writing custom class to root file on windows

Dear Rooters,
I am a beginner for root. Now, I am developing a program on windows with Qt. I do not use the Qt interface of Root for gui. I only want to save my data in a root file, so only TFile, TTree, TH1D class were used. To save my data, I created a custom class SpectrumSaveData and used TTree to hold the class in root file. To hold the class in TTree, the class inherits from TObject, and I wrote the LinkDef.h file for it. Then, I use rootcint to generate dictionary files SpectrumSaveData_d.h and SpectrumSaveData_d.cpp. To use the class in my application, I added the four file(SpectrumSaveData.h, SpectrumSaveData.cpp, SpectrumSaveData_d.h and SpectrumSaveData_d.cpp) in my project. I set the Root environment in Qt by including the Pri files that Root peovides in its include folder. I could compile and run the application successfully. I also could read root file including only TH1D. However, When I read the root file including the TTree holding SpectrumSaveData class, the application crashed. After one hour of testing, I found that the application could read and write custom class successfully if I compile it in debug mode in Qt Creator. Only application compiled in release mode will crash when reading custom class. I spent the whole day to find reason, but I got nothing. It seems that application in debug mode contains some important things for custom class, and I do not know if the way I use custom class is right. Can anyone give me some help about it? Thank you in advance. My Qt and Root version is 5.3 and 5.34.