Results 1 to 6 of 6

Thread: Let me know your valid suggession for Memory Leak ..!!!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    157
    Qt products
    Qt3 Qt4
    Thanks
    12
    Thanked 1 Time in 1 Post

    Question Let me know your valid suggession for Memory Leak ..!!!

    Hai all,


    Version : Qt 3.3.4
    Problem : Chance for memory leak..???

    This thread for just to know your valid suggestions.
    I have subclassed the QTableitem like as follows....

    Qt Code:
    1. class MyTableItem : public QTableItem
    2. {
    3. ----
    4.  
    5. MyTableItem( QTable * table, EditType et, const QString & text ): QTableItem( table, et, text ) { }
    6. virtual ~MyTableItem() { }
    7. virtual alignment ( ) const;
    8.  
    9. -----
    10.  
    11. };
    To copy to clipboard, switch view to plain text mode 

    In run time I am calling MyTableItem( ) like as follows.....

    Qt Code:
    1. class MyMainWindow : QMainWindow
    2. {
    3. MyMainWindow( ...., ..... ){ }
    4. ~MyMainWindow();
    5. void refreshTable ();
    6. private:
    7. QTable m_table;
    8.  
    9. };
    10.  
    11.  
    12. void MyMainWindow :: refreshTable ()
    13. {
    14. ------
    15. // m_table is pointer in MyMainWindow Class
    16. m_table->setItem ( row, col , new MyTableItem( m_table , QTableItem::Never , " Text " ) );
    17.  
    18. ------
    19. // i am not using any delete for MyTableItem anywhere.
    20. }
    To copy to clipboard, switch view to plain text mode 


    As Qt promises, will it kill " MyTableItem " created in "refreshTable() " after killing MyMainWindow ....???
    Please let me know ..if chances for MEMORY_LEAK ....!!!!!!!
    Please give me a good suggestion ...


    Thanks in advance.
    Last edited by jacek; 11th December 2006 at 13:07. Reason: changed [html] to [code]

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.