mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +01:00
fix(Foundation): use after free warnings #4189
This commit is contained in:
parent
47ddacd004
commit
cd12420495
@ -302,6 +302,10 @@ public:
|
||||
protected:
|
||||
P activateObject(P pObject)
|
||||
{
|
||||
#if defined(POCO_COMPILER_GCC)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wuse-after-free"
|
||||
#endif
|
||||
try
|
||||
{
|
||||
_factory.activateObject(pObject);
|
||||
@ -312,6 +316,9 @@ protected:
|
||||
throw;
|
||||
}
|
||||
return pObject;
|
||||
#if defined(POCO_COMPILER_GCC)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "CppUnit/TestSuite.h"
|
||||
#include "Poco/AutoPtr.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include <atomic>
|
||||
|
||||
|
||||
using Poco::AutoPtr;
|
||||
@ -66,7 +67,7 @@ namespace
|
||||
}
|
||||
|
||||
private:
|
||||
int _rc;
|
||||
std::atomic<int> _rc;
|
||||
static int _count;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user