Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible memory leaks due to SuppressFinalize in constructors [DNET229] #238

Closed
firebird-automations opened this issue Apr 24, 2009 · 1 comment

Comments

@firebird-automations
Copy link

Submitted by: Michał Ziemski (r_o_o_k)

Votes: 2

Using SuppressFinalize in class constructors is IMHO erroneous.
This causes Finalizers never to get called.
Classes embracing managed components should rather implement proper Dispose/Finalize logic.

Expampe:
FbConnection con = new FbConnection(cStr);
con.Open();
con = null;

The underlying socket will not be closed because the Finalizer in FbConnectionInternal will never be called.

SuppressFinalize is even sometimes called on classes that have no Finalizer (for example GdsConnection).

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.9.0.0 [ 10722 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants