TheMythologist / guardian

Firewall for GTA Online
GNU Lesser General Public License v3.0
45 stars 2 forks source link

Proper unregistering of `WinDivert` #14

Open TheMythologist opened 1 year ago

TheMythologist commented 1 year ago

Current premature termination will cause Windivert DLLs to still be loaded into memory (and thus undeletable)

A simple cleanup script/block

if pydivert.WinDivert.is_registered():
    pydivert.WinDivert.unregister()
TheMythologist commented 1 year ago

Further investigation: We may just need to call pydivert.Windivert.close on the handle instead. But this should be handled with python's with context operator, so this may not be necessary at all.

Reference: https://pythonhosted.org/pydivert/#pydivert.WinDivert.close