Skip to content

Commit c1179d7

Browse files
committed
Removed dispose() and release() from most of implementations as was suggested by Adriano long time ago.
Cleanup old unused debugging feature (RefDeb). Fixed CORE-6433: Several firebird servers crash
1 parent c6861bb commit c1179d7

59 files changed

Lines changed: 121 additions & 722 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/auth/AuthDbg.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,6 @@ int DebugServer::authenticate(Firebird::CheckStatusWrapper* status, Firebird::IS
144144
void DebugServer::setDbCryptCallback(Firebird::CheckStatusWrapper*, Firebird::ICryptKeyCallback*)
145145
{ /* ignore it */ }
146146

147-
int DebugServer::release()
148-
{
149-
if (--refCounter == 0)
150-
{
151-
delete this;
152-
return 0;
153-
}
154-
155-
return 1;
156-
}
157-
158147
DebugClient::DebugClient(Firebird::IPluginConfig*)
159148
: str(getPool())
160149
{ }
@@ -212,17 +201,6 @@ int DebugClient::authenticate(Firebird::CheckStatusWrapper* status, Firebird::IC
212201
return AUTH_FAILED;
213202
}
214203

215-
int DebugClient::release()
216-
{
217-
if (--refCounter == 0)
218-
{
219-
delete this;
220-
return 0;
221-
}
222-
223-
return 1;
224-
}
225-
226204
} // namespace Auth
227205

228206
#endif // AUTH_DEBUG

src/auth/AuthDbg.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class DebugServer FB_FINAL :
5555
int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IServerBlock* sBlock,
5656
Firebird::IWriter* writerInterface);
5757
void setDbCryptCallback(Firebird::CheckStatusWrapper*, Firebird::ICryptKeyCallback*);
58-
int release();
5958

6059
private:
6160
Firebird::string str;
@@ -69,7 +68,6 @@ class DebugClient FB_FINAL :
6968
DebugClient(Firebird::IPluginConfig*);
7069

7170
int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IClientBlock* sBlock);
72-
int release();
7371

7472
private:
7573
Firebird::string str;

src/auth/SecDbCache.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,6 @@ class CachedSecurityDatabase FB_FINAL
6868

6969
// ITimer implementation
7070
void handler();
71-
72-
int release()
73-
{
74-
if (--refCounter == 0)
75-
{
76-
delete this;
77-
return 0;
78-
}
79-
80-
return 1;
81-
}
82-
8371
void close();
8472

8573
Firebird::Mutex mutex;

src/auth/SecureRemotePassword/client/SrpClient.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class SrpClient : public StdPlugin<IClientImpl<SrpClient, CheckStatusWrapper> >
4949

5050
// IClient implementation
5151
int authenticate(CheckStatusWrapper*, IClientBlock* cb);
52-
int release();
5352

5453
private:
5554
RemotePassword* client;
@@ -178,16 +177,6 @@ int SrpClient::authenticate(CheckStatusWrapper* status, IClientBlock* cb)
178177
return AUTH_SUCCESS;
179178
}
180179

181-
int SrpClient::release()
182-
{
183-
if (--refCounter == 0)
184-
{
185-
delete this;
186-
return 0;
187-
}
188-
return 1;
189-
}
190-
191180
namespace
192181
{
193182
SimpleFactory<SrpClientImpl<Sha1> > factory_sha1;

src/auth/SecureRemotePassword/manage/SrpManagement.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -723,17 +723,6 @@ class SrpManagement FB_FINAL : public Firebird::StdPlugin<Firebird::IManagementI
723723
}
724724
}
725725

726-
int release()
727-
{
728-
if (--refCounter == 0)
729-
{
730-
delete this;
731-
return 0;
732-
}
733-
734-
return 1;
735-
}
736-
737726
private:
738727
Firebird::RefPtr<Firebird::IFirebirdConf> config;
739728

src/auth/SecureRemotePassword/server/SrpServer.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ class SrpServer : public StdPlugin<IServerImpl<SrpServer, CheckStatusWrapper> >
8383
// IServer implementation
8484
int authenticate(CheckStatusWrapper* status, IServerBlock* sBlock, IWriter* writerInterface);
8585
void setDbCryptCallback(CheckStatusWrapper* status, ICryptKeyCallback* callback);
86-
int release();
8786

8887
~SrpServer()
8988
{
@@ -401,15 +400,6 @@ void SrpServer::setDbCryptCallback(CheckStatusWrapper* status, ICryptKeyCallback
401400
cryptCallback = callback;
402401
}
403402

404-
int SrpServer::release()
405-
{
406-
if (--refCounter == 0)
407-
{
408-
delete this;
409-
return 0;
410-
}
411-
return 1;
412-
}
413403

414404
SimpleFactory<SrpServerImpl<Sha1> > factory_sha1;
415405
SimpleFactory<SrpServerImpl<sha224> > factory_sha224;

src/auth/SecurityDatabase/LegacyClient.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@ int SecurityDatabaseClient::authenticate(Firebird::CheckStatusWrapper* status, F
5454
return AUTH_SUCCESS;
5555
}
5656

57-
int SecurityDatabaseClient::release()
58-
{
59-
if (--refCounter == 0)
60-
{
61-
delete this;
62-
return 0;
63-
}
64-
return 1;
65-
}
66-
6757
namespace {
6858
Firebird::SimpleFactory<SecurityDatabaseClient> factory;
6959
}

src/auth/SecurityDatabase/LegacyClient.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class SecurityDatabaseClient FB_FINAL :
4545

4646
// IClient implementation
4747
int authenticate(Firebird::CheckStatusWrapper*, Firebird::IClientBlock* data);
48-
int release();
4948
};
5049

5150
void registerLegacyClient(Firebird::IPluginManager* iPlugin);

src/auth/SecurityDatabase/LegacyManagement.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class SecurityDatabaseManagement FB_FINAL :
4545
void commit(Firebird::CheckStatusWrapper* status);
4646
void rollback(Firebird::CheckStatusWrapper* status);
4747

48-
int release();
48+
int release() override;
4949

5050
private:
5151
Firebird::RefPtr<Firebird::IFirebirdConf> config;

src/auth/SecurityDatabase/LegacyServer.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ class SecurityDatabaseServer FB_FINAL :
137137
int authenticate(CheckStatusWrapper* status, IServerBlock* sBlock,
138138
IWriter* writerInterface);
139139
void setDbCryptCallback(CheckStatusWrapper*, ICryptKeyCallback*) { } // ignore
140-
int release();
141140

142141
private:
143142
RefPtr<IPluginConfig> iParameter;
@@ -404,17 +403,6 @@ int SecurityDatabaseServer::authenticate(CheckStatusWrapper* status, IServerBloc
404403
}
405404
}
406405

407-
int SecurityDatabaseServer::release()
408-
{
409-
if (--refCounter == 0)
410-
{
411-
delete this;
412-
return 0;
413-
}
414-
415-
return 1;
416-
}
417-
418406
namespace {
419407
SimpleFactory<SecurityDatabaseServer> factory;
420408
}

0 commit comments

Comments
 (0)