petschau / WinFellow

WinFellow
https://petschau.github.io/WinFellow/
GNU General Public License v2.0
88 stars 13 forks source link

winDrvDetectMemoryLeaks crash (debug mode) #129

Closed petschau closed 11 months ago

petschau commented 11 months ago

Regression in v0.5.11 debug mode. The problem is that this function calls _core.Fileops->GetGenericFileName() after core has been deleted.

carfesh commented 11 months ago

This is an interesting one; for that to reliably do what it does, it needs to be the very last call made before the program exits. Would it make sense to make the function static, so that it can be called without having an instance of the object? I believe it does not rely on other members of the class?

carfesh commented 11 months ago

Possibly solved in f1cf7ebb583b3a250cb11cfc618df25251b425bc - by accident I issued this commit into master instead of a bugfix branch; maybe it is time for some branch policies preventing commits directly into master :)

This is more or less a workaround which implements the minimal parts needed to write the file into the function. As GetGenericFilename itself relies on another function to resolve variables, it was not easy to change it into a static function. I'm sure there are cleaner ideas, but in my case the crash was gone and the file was written correctly.