(research) Ends the application when max frame hase been reached

This allows to use -f option in c generated applications.