main: Shared pointer can be released when main function exites

Change-Id: Ie62254f62c7c2df221b3e857291be95cffc2f03b