cec: fixed crash on exit after the last commit.