Page MenuHome

Fix reference count for COM handling - Variation 2
ClosedPublic

Authored by Robert Guetzkow (rjg) on Apr 18 2022, 9:54 PM.

Details

Summary

This patch fixes T97338. The reference count for IShellItem *pSI is reduced, preventing the memory leak. For IFileOperation *pfo the decrement of the reference count is only attempted when the pointer is not NULL.

This is a variation of D14657 that uses nested if/else statements.

Diff Detail

Repository
rB Blender

Event Timeline

Robert Guetzkow (rjg) requested review of this revision.Apr 18 2022, 9:54 PM
Robert Guetzkow (rjg) created this revision.

Instead of the booleans, you could just put the freeing inside the nested ifs in the proper place.

Sure, that's also possible. It was the original version I had implemented, which I found a bit difficult to read in combination with the nesting.

Edit: I'll update the diff.

  • Removed booleans
This revision is now accepted and ready to land.Apr 19 2022, 2:45 PM