Don't try to access the printer object after it is deleted.
@@ -505,12 +505,16 @@ papplPrinterCreate(
//
void
-papplPrinterDelete(pappl_printer_t *printer) /* I - Printer */
+papplPrinterDelete(
+ pappl_printer_t *printer) // I - Printer
{
+ pappl_system_t *system = printer->system;
+ // System
+
// Remove the printer from the system object...
- pthread_rwlock_wrlock(&printer->system->rwlock);
- cupsArrayRemove(printer->system->printers, printer);
- pthread_rwlock_unlock(&printer->system->rwlock);
+ pthread_rwlock_wrlock(&system->rwlock);
+ cupsArrayRemove(system->printers, printer);
+ pthread_rwlock_unlock(&system->rwlock);
}
