|
Crash when trying to chance working directory |
Hrod Ruck
Member #15,433
December 2013
|
When I try to change directories to load an image with the following code: |
l j
Member #10,584
January 2009
|
printf("%s\n", al_get_current_directory); edit: the above code causes a memory leak. So for proper practice... char *directory = al_get_current_directory(); // use variable al_free(directory); // clean up
|
Hrod Ruck
Member #15,433
December 2013
|
No, it was actually an error. Now it prints the directory where my source is. THank you! However, I've still got two problems: there is an image there that doesn't load AND my program crashes when I try to get my current directory. |
ph03nix
Member #15,028
April 2013
|
do you call al_init before al_get_current_directory? |
Hrod Ruck
Member #15,433
December 2013
|
Yes, that was the case. Thank you. |
|