c++ - Forcing the operation system to perform cleanup after a "subroutine" -
i'm writing images-processing program in c++. purpose, have modified third party program (an edge detector) static library use in my program.
it seams original edge detector relied on os clean memory after main function has been executed. unfortunately, after have modified original code, main function became "common" repeatedly called function , no automatic cleaning therefore performed. result huge memory leak every time function called.
i'm not able exhaustively review whole code of detector fix this. i'd therefore ask: in general, there way separate "subroutine" of whole program (in case detector) rest , force os clean after subroutine if stand-alone program? there solution use of threads, example?
thank replies.
if using *nix platform, perhaps fork
library call.
Comments
Post a Comment