From 08af89fedaf9f1fa8abb9f58c6e35bd25c1a2ce3 Mon Sep 17 00:00:00 2001 From: Michael Pfeiffer Date: Sun, 10 Oct 2010 09:09:51 +0000 Subject: [PATCH] * The add-on additionally to the print_server gets loaded by printer add-ons too. The USBPrinterRoster thread has to be stopped before the transport add-on gets unloaded. This fixes the bug described in ticket #6008 that a page gets printed again and again. * Added comment that the add-on might access a deleted object if the printer get disconnected during printing. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38915 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/print/transports/usb_port/USBTransport.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/add-ons/print/transports/usb_port/USBTransport.cpp b/src/add-ons/print/transports/usb_port/USBTransport.cpp index a272685973..7c0f757fee 100644 --- a/src/add-ons/print/transports/usb_port/USBTransport.cpp +++ b/src/add-ons/print/transports/usb_port/USBTransport.cpp @@ -32,6 +32,9 @@ #define PIT_VENDOR_SPECIFIC 0xff +// TODO handle disconnection of printer during printing +// currently the USBPrinter will be deleted and USBTransport will still +// access the memory class USBPrinter { public: USBPrinter(const BString& id, const BString& name, @@ -271,6 +274,7 @@ USBTransport::USBTransport(BDirectory *printer, BMessage *msg) USBTransport::~USBTransport() { + gUSBPrinterRoster.Stop(); }