Thread: Link List / Dynamic memory

  1. #16
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Where do you create FoodLists?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  2. #17
    Registered User
    Join Date
    Sep 2006
    Location
    vancouver wa
    Posts
    221
    I dont know what you mean!
    I have 2 header files, each contain classes.
    ones Nutricalc and ones Foodlists.

  3. #18
    Registered User
    Join Date
    Sep 2006
    Location
    vancouver wa
    Posts
    221
    Here is almost all of the project.

  4. #19
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Right, I mean where is there a FoodLists variable being instantiated?
    Somewhere in the code, I suspect you have something like this:
    Code:
    FoodLists list;
    or
    Code:
    FoodLists *list = new FoodLists;
    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #20
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Which of those files contain your main()?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #21
    Registered User
    Join Date
    Sep 2006
    Location
    vancouver wa
    Posts
    221
    FoodData contains main()
    thats almost the whole program minus 2 files for validation.
    I need to get some sleep, i will check back in the morning.
    Last edited by mrsirpoopsalot; 05-26-2009 at 04:14 AM.

  7. #22
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    So, the destructor for FoodLists should be called when you exit main(). If it's not, either your debugger or compiler are broken.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  2. Memory Allocation for self made Linked List
    By jsimpson in forum C Programming
    Replies: 5
    Last Post: 03-10-2006, 02:14 AM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM