serge-rgb / milton

An infinite-canvas paint program
GNU General Public License v3.0
1.53k stars 133 forks source link

Fix: prevent mlt_file_path memory from being deinitialized. #135

Closed aameen951 closed 5 years ago

aameen951 commented 5 years ago

In release mode, the file path buffer buffer is getting reused after the scope is closed by other variables causing the mlt_file_path to become corrupted.

You can reproduce this by passing the .mlt file path on the command line or by double-clicking the file. You will see the file name corrupted in the menu bar at the top and new save files appear in the current directory with random names.

The simplest solution is to just remove the scope.

serge-rgb commented 5 years ago

Thanks! I'll merge it. Come to think of it, milton_main should probably take a PATH_CHAR instead of a char*...