trexinc / evil-programmers

Misc. Far plugins and tools by evil programmers
66 stars 26 forks source link

Implement GetFilesW (Panel API) #53

Closed vladfolts closed 3 years ago

vladfolts commented 3 years ago

@alabuzhev Here you can reproduce the problem I described here: https://github.com/trexinc/evil-programmers/pull/52#issuecomment-955820153 Use 2cb92c5 commit and replace get_no_steal with get here: https://github.com/trexinc/evil-programmers/pull/53/commits/2cb92c5651f612fe617e6c0b037d0d6b64c1cf6f#diff-8062c8908148b1cfc50063ce13ca8f61331f92d0959e7e3a4aa9ab47f0d58f00R61 You are going to get an unexpected item in python's GetFilesW callback or maybe crash etc.

The last commit uses UserData.FreeData approach instead so I think it is ready to be merged.

alabuzhev commented 3 years ago

Looks like it's by design: https://bugs.farmanager.com/view.php?id=1699 https://forum.farmanager.com/viewtopic.php?t=6176

Far calls FreeFindData early to avoid double memory consumption. UserData.FreeData approach is correct.

vladfolts commented 3 years ago

@alabuzhev Thanks for the clarification.

alabuzhev commented 3 years ago

Thank you