Problem: 1357782

Title: (Memory, leak) TApplication::OpenOld leaks on OpenOld of unsupported file type

Received: Jun 11 1996 9:34AM


I just discovered a memory leak in MacApp 3.3.1. The problem is in TApplication::OpenOld. You iterate over the list of file, delete it from the list, and try to make a document associated with the file. If the file is unsupported by the application, it is never disposed of, causing a memory leak.
Fix:

A portion of this is a justifiable memory leak but this particular one isn't. So I now dispose of the aFile if CanopenDocument returns a false for any reason. This is done before the catch block gets a chance at it so it should be pretty safe.