I have found one memory leak issue in the previous implementation and would like to submit this new patch on top of the Pg_Event_Trigger_V5.patch. Please find the below attached patch and valgrind output and let me know your inputs and suggestions.
* Why both with the doNeedEvtTrgRefresh flag here? As it's not used anywhere else, why not just put the Refresh() call into the first conditional?
Yes, True. There is no need of Flag doNeedEvtTrgRefresh.
* I assume the Refresh call is there to find the "Event Triggers" node and refresh it? If so, there's no guarantee that the next sibling will actually be the event triggers node - in the future, we may add a new node type that sits in that position, or the user may have enabled or disabled some node types, including Event Triggers.
Ah. Thanks Dave for your suggestions. I have followed another approach to fix this issue. Kindly check this latest patch and share you inputs and suggestions. This patch also fixes the memory leak and schema refresh activities.
* The same comment as above applies to browser->GetPrevSibling().