CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Any Idea How Can I prevent Memory Leaks?

  1. #1
    Join Date
    Dec 2018
    Location
    Iowa
    Posts
    1

    Any Idea How Can I prevent Memory Leaks?

    Hello Friends,

    Can anyone suggest how can I prevent memory leaks in Windows 10

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,320

    Re: Any Idea How Can I prevent Memory Leaks?

    To provide a detailed answer, much more info is needed around your code. But in general, memory that is allocated should be freed when it is no longer required. Repeatedly allocating memory for objects without releasing previously allocated memory can indeed cause 'memory leaks'. Also created objects (brush etc) should be deleted when not required as these consume memory which isn't automatically released.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.8.2)

  3. #3
    Join Date
    Mar 2020
    Posts
    1

    Re: Any Idea How Can I prevent Memory Leaks?

    I have been an android developer for quite some time now. And I apprehended that most of that time, I tend to spend on adding new features to an app or working on visual increases of the app, rather than focusing on the core issues like appearance and quality.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,847

    Re: Any Idea How Can I prevent Memory Leaks?

    Quote Originally Posted by ritiksharma View Post
    I have been an android developer for quite some time now. And I apprehended that most of that time, I tend to spend on adding new features to an app or working on visual increases of the app, rather than focusing on the core issues like appearance and quality.
    Is it your answer? Whom?
    Or you attempted to ask? What?
    Victor Nijegorodov

  5. #5
    Join Date
    Mar 2020
    Posts
    5

    Re: Any Idea How Can I prevent Memory Leaks?

    Make it out to your developer. There should be something wrong.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)