Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Freeing Allocated Memory

Is there a known problem where memory is allocated (via malloc) in a C Based DLL, passing the allocated memory address back to an appication thru a callback function setting the address as an LParam? What seems to be happening (using NT) is that MFC application crashes whenever the application frees the memory (LParam Address) using free.
0
nweiher
Asked:
nweiher
1 Solution
 
captainkirkCommented:
The memory allocated in the DLL is from its own memory pool unless it is an MFC Extension DLL. You may want to see if you can free the memory inside the DLL.
0
 
gelbertCommented:
Possible problem could be that MFC app and your C dll were compiled with different versions of C runtime library
0
 
DKostovCommented:
Here the problem is basicly the same.
You can see some guidelines about the possible resolution.

http://www1.experts-exchange.com/bin/Q.10261061

captainkirk & gelbert are totally right.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
ShaunWildeCommented:
Under debug - MFC uses a different malloc to that in release to enable it to do memory tracking. so mixing release and debug MFC builds can cause problems the same may also apply to 'vanilla' C dlls also.

0
 
TryCommented:
"DKostov", since you were the one who answered the question at the address you've given, why not simply copy it over here!
0
 
DKostovCommented:
"Try",
The discussion there is huge.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now