473,378 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

unmanaged resource

Hello everyone,
I think unmanaged resource means the resources (e.g. memory and file
handler) which is used directly (new, FILE*) other than using a
wrapper class (Resource Acquisition Is Initialization) or auto_ptr to
wrap it. Is my understanding correct?

Here is a sample about what is unmanaged resource.

--------------------
http://www.gotw.ca/gotw/066.htm

Moral #3: Always perform unmanaged resource acquisition in the
constructor body, never in initializer lists. In other words, either
use "resource acquisition is initialization" (thereby avoiding
unmanaged resources entirely) or else perform the resource acquisition
in the constructor body.
--------------------
thanks in advance,
George
Jan 2 '08 #1
1 1820
On 2008-01-02 09:14, George2 wrote:
Hello everyone,
I think unmanaged resource means the resources (e.g. memory and file
handler) which is used directly (new, FILE*) other than using a
wrapper class (Resource Acquisition Is Initialization) or auto_ptr to
wrap it. Is my understanding correct?

Here is a sample about what is unmanaged resource.

--------------------
http://www.gotw.ca/gotw/066.htm

Moral #3: Always perform unmanaged resource acquisition in the
constructor body, never in initializer lists. In other words, either
use "resource acquisition is initialization" (thereby avoiding
unmanaged resources entirely) or else perform the resource acquisition
in the constructor body.
--------------------
You are kind of correct, an unmanaged resource is a resource which you
explicitly have to free when you are done using it. If you do not free
it and you no longer have a handle to it you have a resource-leak. It is
important to notice that not all wrapper necessarily free resources.

--
Erik Wikström
Jan 2 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
5
by: Barry Anderberg | last post by:
I'm using a tool by Sci-Tech called the .NET Memory Profiler. We have a massive .NET/C# application here and it has been exhibiting memory leak behavior for some time. Attempting to remedy the...
6
by: Eric | last post by:
for example: SqlConnection is used in my project, how can I know if all connections were closed after open and execution. If some guys forget to close connections after using, how can i check it...
4
by: Rachel Suddeth | last post by:
What is the difference between a managed/unmanaged resource, and how do you tell which is which? I'm trying to understand how to write some Dispose() methods, and we are supposed to put code that...
3
by: Steve | last post by:
I have former VC++ 6.0 application which was ported to .NET. Now we continue to develop this app under VS.NET. The app now contains both managed and unmanaged classes. Now I have a problem with...
4
by: Maxwell | last post by:
Hello, Newbie question here for disposing of unmanaged resources in MC++.NET. I have a managed VS.NET 2003 MC++ wrapper class that wraps a unmanaged C++ dll. What I am trying to figure out is...
7
by: thomson | last post by:
Hi All, Connecting to SQL Server we say its an Un Managed connection Can any one tell me whether this statement objConnection = new System.Data.OleDb.OleDbConnection(strConnectionString); ...
5
by: ttc | last post by:
Hi All, I have a managed class that inherits from an unmanged class. The question is, if the object of the manged class get garbage collected, will the memory be free automatically for me or...
6
by: George2 | last post by:
Hello everyone, I think unmanaged resource means the resources (e.g. memory and file handler) which is used directly (new, FILE*) other than using a wrapper class (Resource Acquisition Is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.