简体   繁体   中英

c++ win32 SysLink memory leak

I'm getting some unusual memory leak in a native c++ win32 application. It has a dialog which has some text and some URL links, which are made with SysLink control. The problem is when i click on the syslink (only for the first time and doesn't matter which link) i get a increase in memory usage for about ~400-500kb (the whole application uses 1.5MB). The code that opens the URL:

  ShellExecute(NULL, L"open", item.szUrl, NULL, NULL, SW_SHOW); 

Can someone explain why does ShellExecute allocate so much memory and how can i free it after the call.

I'm not familiar with the libraries you are using but if it only happens once and only for the first call, then it could likely just be that the library is loading up some resources that it needs.

Usually that memory is not freed until the end of the process. But you could load the library yourself and then unload it if you are worried about the memory usage... again not familiar with your libraries but there may also be a cleanup function provided to minimise memory usage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM