Revert "Fix memory leak in plugins when navigating pages"

This reverts commit 3714d9fc24f6406c3e881009dde8986a387c1814.