diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2024-03-19 09:27:28 +0300 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-03-21 09:15:43 +0900 |
commit | 4ab92f6b7924b3a24dd3146cfd349d45fe63c995 (patch) | |
tree | 397475a1d0035d510ca34f8e69921c085d90b396 | |
parent | 41c8fa0f9dc70a101cc56f1b11737b8544295fee (diff) | |
download | tqt3-4ab92f6b7924b3a24dd3146cfd349d45fe63c995.tar.gz tqt3-4ab92f6b7924b3a24dd3146cfd349d45fe63c995.zip |
TQPrintDialog: cleanup data requested from libcups
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit c2c385eef261e8bba46d360ceccdb604733f07c0)
-rw-r--r-- | src/dialogs/qprintdialog.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dialogs/qprintdialog.cpp b/src/dialogs/qprintdialog.cpp index 764c480f6..72e84e1dc 100644 --- a/src/dialogs/qprintdialog.cpp +++ b/src/dialogs/qprintdialog.cpp @@ -796,7 +796,9 @@ static char * parseCupsOutput( TQListView * printers ) cups_dest_t * d; TQLibrary lib( "cups" ); typedef int (*CupsGetDests)(cups_dest_t **dests); + typedef void (*CupsFreeDests)(int num_dents, cups_dest_t *dests); CupsGetDests _cupsGetDests = (CupsGetDests)lib.resolve( "cupsGetDests" ); + CupsFreeDests _cupsFreeDests = (CupsFreeDests)lib.resolve( "cupsFreeDests" ); if ( _cupsGetDests ) { nd = _cupsGetDests( &d ); if ( nd < 1 ) @@ -810,6 +812,9 @@ static char * parseCupsOutput( TQListView * printers ) defaultPrinter = tqstrdup( d[n].instance ); n++; } + if ( _cupsFreeDests ) { + _cupsFreeDests(nd, d); + } } return defaultPrinter; } |