[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] KProtocolManager
From:       Szombathelyi "György" <gyurco () freemail ! hu>
Date:       2004-03-27 17:48:27
Message-ID: 200403271848.50167.gyurco () freemail ! hu
[Download RAW message or body]

____________________________________________________________________
Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
Probald ki most! http://www.freestart.hu

Hello!

I attached a proposed patch to KProtocolManager, which will use only one 
global variable for KProtocolManagerPrivate. The current version uses the 
variable "d" and "globalRef", and there are situations where these pointers 
could go different. The patch corrects this, with only using 'd'. Actually 
the patch fixes a real crash with KABC::StdAddressBook in some situations.
It should be applied to HEAD and 3.2.

Bye,
György

["kio.diff" (text/x-diff)]

Index: kprotocolmanager.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kio/kprotocolmanager.cpp,v
retrieving revision 1.136
diff -u -p -u -r1.136 kprotocolmanager.cpp
--- kprotocolmanager.cpp	15 Jan 2004 22:01:43 -0000	1.136
+++ kprotocolmanager.cpp	27 Mar 2004 17:24:35 -0000
@@ -52,16 +52,15 @@ public:QString proxy;QString modifiers;QString useragent;
-   static KProtocolManagerPrivate *globalRef;};
-KProtocolManagerPrivate *KProtocolManagerPrivate::globalRef = 0;
+static KProtocolManagerPrivate* d = 0;static KStaticDeleter<KProtocolManagerPrivate> \
kpmpksd;KProtocolManagerPrivate::KProtocolManagerPrivate():config(0), http_config(0), \
                init_busy(false){
-   globalRef = kpmpksd.setObject(globalRef, this);
+   d = kpmpksd.setObject(d, \
this);}KProtocolManagerPrivate::~KProtocolManagerPrivate() @@ -70,7 +69,6 @@ \
                KProtocolManagerPrivate::~KProtocolManagdelete http_config;}
-static KProtocolManagerPrivate* d = 0;// DEFAULT USERAGENT STRING#define \
CFG_DEFAULT_UAGENT(X) \ @@ -79,11 +77,10 @@ QString("Mozilla/5.0 (compatible; \
                Konquevoid KProtocolManager::reparseConfiguration(){
-  delete d;
-  d = 0;
+  kpmpksd.destructObject();// Force the slave config to re-read its config...
-  KIO::SlaveConfig::self()->reset ();
+  KIO::SlaveConfig::self()->reset();}KConfig *KProtocolManager::config()



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic