bug 1196460 - remove proxy's ids when they are destroyed r=surkov

This commit is contained in:
Trevor Saunders 2015-08-27 17:24:13 -04:00
parent 61e40ac5c7
commit 20ef8ce558
3 changed files with 16 additions and 2 deletions

View File

@ -60,8 +60,6 @@ static gAccessibles = 0;
#ifdef _WIN64
IDSet AccessibleWrap::sIDGen;
static const uint32_t kNoID = 0;
#endif
static const int32_t kIEnumVariantDisconnected = -1;

View File

@ -177,6 +177,11 @@ public: // construction, destruction
static IDispatch* NativeAccessible(Accessible* aAccessible);
#ifdef _WIN64
uint32_t GetExistingID() const { return mID; }
static const uint32_t kNoID = 0;
#endif
protected:
virtual ~AccessibleWrap();

View File

@ -59,6 +59,17 @@ a11y::ProxyDestroyed(ProxyAccessible* aProxy)
if (!wrapper)
return;
auto doc =
static_cast<DocProxyAccessibleWrap*>(WrapperFor(aProxy->Document()));
#ifdef _WIN64
uint32_t id = wrapper->GetExistingID();
if (id != AccessibleWrap::kNoID) {
doc->RemoveID(id);
}
#else
doc->RemoveID(-reinterpret_cast<int32_t>(wrapper));
#endif
wrapper->Shutdown();
aProxy->SetWrapper(0);
wrapper->Release();