shared/main-func: also close the polkit agent automatically
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 Nov 2018 14:52:40 +0000 (15:52 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 Nov 2018 17:40:02 +0000 (18:40 +0100)
The agent is closed after the static destuctors but before the pager.
No users of DEFINE_MAIN_FUNCTION* were using a polkit agent, so this makes no
functional difference.

src/shared/main-func.h

index 24bf6c9..d8fd89d 100644 (file)
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 
 #include "pager.h"
+#include "spawn-polkit-agent.h"
 #include "static-destruct.h"
 
 #define _DEFINE_MAIN_FUNCTION(impl, ret)                                \
@@ -11,6 +12,7 @@
                 int r;                                                  \
                 r = impl(argc, argv);                                   \
                 static_destruct();                                      \
+                polkit_agent_close();                                   \
                 pager_close();                                          \
                 return ret;                                             \
         }