Remember that there's no rule that says that a query (etc.) opened in a function has to be closed there, or that an object created in a function has to be freed there.
The limit is whether you're confident that you understand the code that you're writing, and a part of that is properly documenting or at least commenting the behaviour of each function: i.e. something like "It's the caller's responsibility to close and free the TQuery created in this function".
MarkMLl