Consultor Eletrônico



Kbase P179041: User Controls that have events attached to them cause parent forms to not get garbage collected
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/2/2011
Status: Verified

SYMPTOM(s):

User Controls that have events attached to them cause parent forms to not get garbage collected

Problem goes away if the events are programmatically unsubscribed before closing the form

FACT(s) (Environment):

OpenEdge 10.2B
Windows

CAUSE:

Bug# OE00202998

CAUSE:

The fact that the parent forms do not get garbage collected is because there is a circular reference between the user control and the object that subscribed to events in the user control. When you subscribe to the event it is a common belief that the subscriber holds a reference to the subscribed object. In fact it is the opposite. The event subscription holds a reference to the object that subscribed to it so that it can raise the event.

FIX:

Upgrade to OpenEdge 10.2B04

Workaround: Modify your code to remove the event subscription in the forms FormClosing event