After adding ofLogToFile(), app crashing on exit

Since adding ofLogToFile(“log.txt”) to my app it crashes on exit (Cmd+Q)

Is there some clean up I’m meant to do - to release the file or something?

I’m on OS X 10.7.4, XCode 4.3.3, 0071 release

Thanks in advance!

Very delayed reply to this thread but I saw a similar issue. Not sure what’s causing the issue yet but I was able to fix the crash simply by adding the following:

In testApp.h

  
  
void exit();  
  

In testApp.cpp

  
  
void testApp::exit() {  
    ofLogToConsole();  
}  
  

By switching the log back to console right before exit it seems to at least quit correctly.

1 Like

Thanks for this, just solved my problem, this should at least be in the documentation.

I also notice that with OF0.11.1 for one specific project.
I always use ofLogToFile for all my projects and I never notice that. This time it’s a big project with addons, many files, … and I can’t guess where it come from.
Switching to

ofLogToConsole();

resolve the crash for me too