473,651 Members | 3,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ReleaseComObjec t or =null

What is the difference between writtinig
System.Runtime. InteropServices .Marshal.Releas eComObject(ob)

and writting ob=null ?. What will happen with my object in memory after
those operations?


Nov 16 '05 #1
1 1642
What is the difference between writtinig
System.Runtime .InteropService s.Marshal.Relea seComObject(ob)
and writting ob=null ?.
The former decrements the internal reference count of the RCW and
possibly releases the underlying COM object.

The latter just sets your reference to the object to null, it doesn't
affect the object itself in any way (though it may become eligible for
garbage collection some time in the future).

What will happen with my object in memory after
those operations?


It depends on of there are other references to the same object.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2

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

Similar topics

5
3997
by: ahmadzia673 | last post by:
I am using a COM component in my ASP.Net application. When i try to release it from memory by using Marshal.ReleaseComObject, its not working. The memory is still leaks. What to do? Is there any other way to prevent from this leakage? Please help me!
3
2113
by: iStrain | last post by:
Hiya. I'm _sure_ this is an FAQ, but Googling hasn't produced the answer in a way I can make sense out of. I know I should get this, but so far no way... I'm creating tables and doing queries in Perl, and Nulls have started to bother me greatly. The first issue is, as far as I understand it, a column should be NOT NULL if it is necessary (required) data. Now, if a column doesn't have to be NOT NULL; that is, it's not _required_ data,...
5
4239
by: Mike MacSween | last post by:
This as the row source for a combo: SELECT qryRole.RoleID, qryRole.Role FROM qryRole WHERE (((qryRole.RoleID) Not In (SELECT RoleID FROM qryRoleEvent INNER JOIN qryEvent ON qryRoleEvent.EventID = qryEvent.EventID WHERE ProdID = Forms!frmProductions!ProdID))) ORDER BY qryRole.Role; If there is just one RoleID with a null value in the subquery then the main
2
2000
by: jason | last post by:
hello everyone, i have had a suppot ticket open with microsoft for some time to investigate a memory leak issue we are experiencing on our production web servers. the web servers host both ASP classic and ASP.NET applications, and the leak is caused, at least in part, by the ASP.NET appliactions according to our support engineer. this is what he says: After a bit of research I was able to determine more on this stack. The
0
1147
by: Christian Havel | last post by:
Hi, we are using a framework which is based on the Enterprise Library June 2005. When I am locking a object (successfull) and let the application run further I receive a NullReferenceException (Problem with: System.Runtime.InteropServices.Marshal.ReleaseComObject). In the eventview I see a error "Failed to fire the WMI Event DataConnectionOpenedEvent" Exception: System.Exception: The scheme for the assembly was not registered with WMI.
1
1323
by: Christian Havel | last post by:
Hi, we are using a framework (which is based on the Microsoft Enterprise Library) and retrieve a ReleaseCOMObject Exception. When I try to debug I can find out any information about the COM object. How can I find out which COM object is responsible for the exception? Thanks
1
1884
by: Christian Havel | last post by:
Hi, I have the problem, that I receive a ReleaseComObject exception from a used framework which is based on the Microsoft Enterprise Library. How can I find out, from whom this exception is thrown? Thanks Christian
1
1522
by: Christian Havel | last post by:
Hi, on shutdown I receive the exception ReleaseComObject. Following the call stack when the exception occures. mscorlib.dll!System.Runtime.InteropServices.Marshal.ReleaseComObject(System.Object o = <Nicht definierter Wert>) + 0x18 Bytes system.management.dll!System.Management.Instrumentation.MetaDataInfo.Dispose() + 0x15 Bytes system.management.dll!System.Management.Instrumentation.MetaDataInfo.Finalize() + 0x1b Bytes I already added...
0
2728
by: xrxst32 | last post by:
Hello there, I have some doubts about the best practice for using COM automation, the Runtime Callable Wrapper (RCW) and Marshal.ReleaseComObject. So the question is/are: Do I need to release each COM object explicit by a call to Marshal.ReleaseComObject, does the RCW take care of that or does it leaks unmanaged resources?
0
8278
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8807
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8701
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7299
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5615
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1912
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.