Search:

Type: Posts; User: Elysia

Search: Search took 0.25 seconds.

  1. Replies
    17
    Views
    5,000

    Sure, you can use heap objects whenever you want,...

    Sure, you can use heap objects whenever you want, but you can't escape from the fact that when you do, you'll also be introducing potential bugs in your code, beucase those objects must be freed,...
  2. Replies
    17
    Views
    5,000

    Of course you should use heap objects when you...

    Of course you should use heap objects when you need them, but the general idea is to avoid them IF you don't need them. What you don't create, you don't need to free.



    Wow. Good advice. I'll...
  3. Replies
    17
    Views
    5,000

    Of course, that's what I mean. If the memory is...

    Of course, that's what I mean. If the memory is to be freed, let it (if possible) be the function that allocated it. If it must outlive the function, consider setting rules for how. Is it a function...
  4. Replies
    17
    Views
    5,000

    Yes, you should use thoroughly tested objects...

    Yes, you should use thoroughly tested objects rather than making your own to avoid memory leaks. Using vectors instead of arrays is a good thing to make sure you don't get leaks.
    There are, of...
  5. Replies
    17
    Views
    5,000

    Use memory managers or shared pointers, such as...

    Use memory managers or shared pointers, such as boost's shared_ptr, define responsibility for who should clean up the memory and make common exit sections in functions so that everything is cleaned...
Results 1 to 5 of 5