Alexander Larsson wrote:
On Mon, 2006-03-06 at 08:14 -0500, Michael Sweet wrote:Alexander Larsson wrote:On Sat, 2006-03-04 at 12:27 -0500, Michael Sweet wrote:ppd_text_to_utf8() leaks memory for UTF-8 encoded text - you can set encoding to a constant string there, too!I don't see the leak. It just returns a strdup of the passed in text (which is supposed to be freed by callers).OK, so then you'll crash when the caller tries to free the constant strings you are returning?!?Eh? I return either: return g_strdup (text); or: res = g_strdup ("???"); or: res = g_convert (text, -1, "UTF-8", encoding, NULL, NULL, NULL); return res; Neither is a constant string.
Oops, sorry, my bad. The first time I looked I saw:
encoding = g_strdup (text);
instead of:
return g_strdup (text);
So much for quick looks at code... :)
OK, sounds reasonable, but I predict that users will be asking why they can't see those options... :)We'll just have to make sure the system print admin dialog is easy to use and easy to find.
... with some way for users to realize that if they don't see their duplex option, that they need to configure the printer with the duplexer. Perhaps something as simple as marking those options "not installed" in the UI so it is obvious why the user can't use them? -- ______________________________________________________________________ Michael Sweet, Easy Software Products mike at easysw dot com Internet Printing and Document Software http://www.easysw.com