зеркало из https://github.com/mozilla/gecko-dev.git
bug 1196460 - remove proxy's ids when they are destroyed r=surkov
This commit is contained in:
Родитель
61f09a90ea
Коммит
5e3e09effc
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче