Results 1 to 2 of 2

Thread: QtScript:Who delete created object - QScript or memory leak will be?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Location
    Russia, South Ural, Chelyabinsk
    Posts
    42
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QtScript:Who delete created object - QScript or memory leak will be?

    Hi to all!
    I have some problem with memory managment in qt script.
    Who delete object without parent (=0) - QtScript, or memory leak will be???

    Qt Code:
    1. //example of script
    2. function testMe()
    3. {
    4. var user = UserManager.createUser(); //UserManager is a var of UserManager class added to script.
    5. //user.Login = "Mike";
    6. }
    To copy to clipboard, switch view to plain text mode 


    //class definition
    Qt Code:
    1. class User: public QObject
    2. {
    3. .....
    4. };
    5.  
    6. class UserManager: public QObject
    7. {
    8. ...
    9.  
    10. public slots:
    11. createUser()
    12. {
    13. return new User(NULL);
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 19th February 2010 at 10:59.

Similar Threads

  1. Qt dll + memory leak
    By Fastman in forum Qt Programming
    Replies: 3
    Last Post: 2nd August 2009, 13:28
  2. Memory leak of Qt?
    By Sheng in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2009, 23:32
  3. Replies: 4
    Last Post: 19th February 2009, 11:10
  4. Memory leak
    By vvbkumar in forum General Programming
    Replies: 4
    Last Post: 2nd September 2006, 15:31
  5. Memory leak
    By zlatko in forum Qt Programming
    Replies: 8
    Last Post: 28th March 2006, 19:02

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.