Home > Mobile >  QT custom window release crash (mad!!! ) please indicate a direction
QT custom window release crash (mad!!! ) please indicate a direction

Time:04-20

Is like that, I now encapsulates a display window and wrote a toolbar window to window, and then the two interface encapsulated into a dynamic library export:
 
M_pGraphicsWidget=new GcImageWidget (this);
M_pToolBox=new GcImageWidgetToolBox (m_pGraphicsWidget, this);
////
M_mainlayout=new QGridLayout ();
M_mainlayout - & gt; AddWidget (m_pToolBox, 0, 0);
M_mainlayout - & gt; AddWidget (m_pGraphicsWidget, 0, 1);

SetLayout (m_mainlayout);


By setting up the layout, let the toolbar and view window can be created out
Then I created a dialog box to call the library, and create the object when structure (test the Demo I did not write here shows what)
 m_ImageView=new GcGraphicsWindow (this); 

Then I close the dialog box will collapse ~ ~ ~ ~ ~ and then debugging found has been the destructor collapse when the object ~ ~


CodePudding user response:

I put the rolls all NEW blocked inside structure, the construction of an empty, empty destructor, that is, when the external NEW just create a window, or collapse, it seems has nothing to do with the window class and toolbar below

CodePudding user response:

Feel is static library is a problem with the link you call? Call the library to return the object's memory is being invoked the DLL in opening up the main process of release resources will have a problem

CodePudding user response:

refer to the second floor mango black response:
feel is static library is a problem with the link you call? Call the library to return the object's memory is being invoked the DLL in opening up the main process of release resources there will be problems
solved now, when I was in the main program destructor initiative to Delete this object, then the air line/; But still think impassability, automatic destructor call module destructor will collapse ~ ~ ~ ~
  •  Tags:  
  • Qt
  • Related