1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
diff -urd psprint/source/printer.old/cupsmgr.cxx psprint/source/printer/cupsmgr.cxx
--- psprint/source/printer.old/cupsmgr.cxx 2005-01-19 18:52:17.000000000 +0000
+++ psprint/source/printer/cupsmgr.cxx 2005-02-07 19:24:36.000000000 +0000
@@ -287,8 +287,8 @@
const char* pResult = NULL;
// if one thread hangs in cupsGetPPD already, don't start another
- if( ! pAttribs )
- {
+// if( ! pAttribs )
+// {
pAttribs = new GetPPDAttribs();
pAttribs->pFunction = m_pcupsGetPPD;
pAttribs->m_aCondition.reset();
@@ -315,7 +315,7 @@
pAttribs->m_aCondition.set();
osl_destroyThread( pAttribs->m_aThread );
}
- }
+// }
return pResult;
}
@@ -360,7 +360,9 @@
m_pDests( NULL ),
m_bNewDests( false )
{
- m_aDestThread = osl_createThread( runDestThread, this );
+ // We cannot cope with this happening in the background for 1.1
+ //m_aDestThread = osl_createThread( runDestThread, this );
+ runDests();
}
CUPSManager::~CUPSManager()
@@ -409,11 +411,12 @@
#ifdef ENABLE_CUPS
// check whether thread has completed
// if not behave like old printing system
- osl::MutexGuard aGuard( m_aCUPSMutex );
+// osl::MutexGuard aGuard( m_aCUPSMutex );
if( ! (m_nDests && m_pDests ) )
return;
+#if 0
// dest thread has run, clean up
if( m_aDestThread )
{
@@ -421,6 +424,7 @@
osl_destroyThread( m_aDestThread );
m_aDestThread = NULL;
}
+#endif
// clear old stuff
m_aCUPSDestMap.clear();
@@ -760,6 +764,10 @@
bool CUPSManager::checkPrintersChanged()
{
bool bChanged = false;
+ // This code causes frequent SALEVENT_PRINTERCHANGED
+ // events, causing crashes in some scenarios in 1.1.
+ // Therefore we only enumerate printer queues on startup.
+#if 0
if( m_aCUPSMutex.tryToAcquire() )
{
bChanged = m_bNewDests;
@@ -771,6 +779,7 @@
if( bChanged )
initialize();
+#endif
return bChanged;
}
Only in psprint/source/printer: cupsmgr.cxx~
|