Results 1 to 4 of 4

Thread: Freeing memory

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Perth, Western Australia
    Posts
    782

    Default Freeing memory

    Hi DAW

    Have the rules tightened up around using Free?

    in 19.0 this went through, but now crashes in 19.1 stepping over Free.

    Code:
    Procedure Test
        Address pTest
        Boolean bOK
        
        Move (Free(pTest)) To bOK
    End_Procedure
    
    
    Send Test
    Cheers,

    Thomas Murphy
    Triumph Business Systems Pty Ltd
    www.triumph.com.au

  2. #2
    Join Date
    Feb 2009
    Posts
    4,590

    Default Re: Freeing memory

    I doubt it

    I suspect it just maps onto the C++ Free function which .....

    If ptr does not point to a memory block previously allocated with malloc, calloc or realloc, and is not a null pointer, it causes undefined behavior.
    Success consists of going from failure to failure without loss of enthusiasm - Winston Churchill

  3. #3
    Join Date
    Jan 2009
    Location
    Richmond, VA
    Posts
    4,969

    Default Re: Freeing memory

    Tom,

    I wonder if this is a side-effect of moving to Visual Studio 2017, which might have changed the underlying behavior of C++ free (as mentioned in the other response).
    Best regards,

    -SWM-

  4. #4
    Join Date
    Feb 2009
    Location
    Perth, Western Australia
    Posts
    782

    Default Re: Freeing memory

    Thank guys, that makes sense. Just a difference I noticed trying to track a similar issue in a web application, where I think an address is being freed twice.

    Cheers
    Tom

    Sent from my SM-G930F using Tapatalk
    Cheers,

    Thomas Murphy
    Triumph Business Systems Pty Ltd
    www.triumph.com.au

Posting Permissions

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