From c7792e69ce3a89e5203b49f862f3ee81b00bb9c9 Mon Sep 17 00:00:00 2001 From: Dawid Halada <44037804+BlueBles@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:59:04 +0200 Subject: [PATCH 1/3] Add dispose in snippets (#10242) --- snippets/cpp/VS_Snippets_Remoting/NclMailASync/cpp/mailasync.cpp | 1 + snippets/csharp/System.Net.Mail/MailAddress/.ctor/mailasync.cs | 1 + .../VS_Snippets_Remoting/NclMailASync/vb/mailasync.vb | 1 + 3 files changed, 3 insertions(+) diff --git a/snippets/cpp/VS_Snippets_Remoting/NclMailASync/cpp/mailasync.cpp b/snippets/cpp/VS_Snippets_Remoting/NclMailASync/cpp/mailasync.cpp index 29feeb6784a..6c1f42c7eb5 100644 --- a/snippets/cpp/VS_Snippets_Remoting/NclMailASync/cpp/mailasync.cpp +++ b/snippets/cpp/VS_Snippets_Remoting/NclMailASync/cpp/mailasync.cpp @@ -82,6 +82,7 @@ int main(array^ args) } // Clean up. delete message; + delete client; client = nullptr; Console::WriteLine("Goodbye."); } diff --git a/snippets/csharp/System.Net.Mail/MailAddress/.ctor/mailasync.cs b/snippets/csharp/System.Net.Mail/MailAddress/.ctor/mailasync.cs index 5622b29c271..62b6d019edb 100644 --- a/snippets/csharp/System.Net.Mail/MailAddress/.ctor/mailasync.cs +++ b/snippets/csharp/System.Net.Mail/MailAddress/.ctor/mailasync.cs @@ -74,6 +74,7 @@ public static void Main(string[] args) } // Clean up. message.Dispose(); + client.Dispose(); Console.WriteLine("Goodbye."); } } diff --git a/snippets/visualbasic/VS_Snippets_Remoting/NclMailASync/vb/mailasync.vb b/snippets/visualbasic/VS_Snippets_Remoting/NclMailASync/vb/mailasync.vb index bc2e2715cc0..4b5a9c51aea 100644 --- a/snippets/visualbasic/VS_Snippets_Remoting/NclMailASync/vb/mailasync.vb +++ b/snippets/visualbasic/VS_Snippets_Remoting/NclMailASync/vb/mailasync.vb @@ -63,6 +63,7 @@ Namespace Examples.SmtpExamples.Async End If ' Clean up. message.Dispose() + client.Dispose() Console.WriteLine("Goodbye.") End Sub End Class From a8a9b8c23acb916dda9b19005be8ab1eab290f75 Mon Sep 17 00:00:00 2001 From: Rich Lander Date: Tue, 13 Aug 2024 10:31:49 -0700 Subject: [PATCH 2/3] Clarify CompareExchange behavior (#10181) * Clarify CompareExchange behavior * Update overload text --- xml/System.Threading/Interlocked.xml | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/xml/System.Threading/Interlocked.xml b/xml/System.Threading/Interlocked.xml index 2018d741d76..c62f0e75cd7 100644 --- a/xml/System.Threading/Interlocked.xml +++ b/xml/System.Threading/Interlocked.xml @@ -507,7 +507,7 @@ 4.1.0.0 - Compares two values for equality and, if they are equal, replaces the first value. + Compares two values for equality and, if they are equal, replaces the first value, as an atomic operation. @@ -540,7 +540,7 @@ The destination, whose value is compared with and possibly replaced. The value that replaces the destination value if the comparison results in equality. The value that is compared to the value at . - Compares two 8-bit unsigned integers for equality and, if they are equal, replaces the first value. + Compares two 8-bit unsigned integers for equality and, if they are equal, replaces the first value, as an atomic operation. The original value in . To be added. The address of is a pointer. @@ -596,7 +596,7 @@ The destination, whose value is compared with and possibly replaced. The value that replaces the destination value if the comparison results in equality. The value that is compared to the value at . - Compares two double-precision floating point numbers for equality and, if they are equal, replaces the first value. + Compares two double-precision floating point numbers for equality and, if they are equal, replaces the first value, as an atomic operation. The original value in . The destination, whose value is compared with and possibly replaced. The value that replaces the destination value if the comparison results in equality. The value that is compared to the value at . - Compares two 16-bit unsigned integers for equality and, if they are equal, replaces the first value. + Compares two 16-bit unsigned integers for equality and, if they are equal, replaces the first value, as an atomic operation. The original value in . To be added. The address of is a pointer. @@ -712,7 +712,7 @@ The destination, whose value is compared with and possibly replaced. The value that replaces the destination value if the comparison results in equality. The value that is compared to the value at . - Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value. + Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value, as an atomic operation. The original value in . The destination, whose value is compared with and possibly replaced. The value that replaces the destination value if the comparison results in equality. The value that is compared to the value at . - Compares two 64-bit signed integers for equality and, if they are equal, replaces the first value. + Compares two 64-bit signed integers for equality and, if they are equal, replaces the first value, as an atomic operation. The original value in . The destination , whose value is compared with the value of and possibly replaced by . The that replaces the destination value if the comparison results in equality. The that is compared to the value at . - Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one. + Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one, as an atomic operation. The original value in . The destination object that is compared by reference with and possibly replaced. The object that replaces the destination object if the reference comparison results in equality. The object that is compared by reference to the object at . - Compares two objects for reference equality and, if they are equal, replaces the first object. + Compares two objects for reference equality and, if they are equal, replaces the first object, as an atomic operation. The original value in . The destination, whose value is compared with and possibly replaced. The value that replaces the destination value if the comparison results in equality. The value that is compared to the value at . - Compares two 8-bit signed integers for equality and, if they are equal, replaces the first value. + Compares two 8-bit signed integers for equality and, if they are equal, replaces the first value, as an atomic operation. The original value in . To be added. The address of is a pointer. @@ -1051,7 +1051,7 @@ If `comparand` and the object in `location1` are equal by reference, then `value The destination, whose value is compared with and possibly replaced. The value that replaces the destination value if the comparison results in equality. The value that is compared to the value at . - Compares two single-precision floating point numbers for equality and, if they are equal, replaces the first value. + Compares two single-precision floating point numbers for equality and, if they are equal, replaces the first value, as an atomic operation. The original value in . The destination, whose value is compared with and possibly replaced. The value that replaces the destination value if the comparison results in equality. The value that is compared to the value at . - Compares two 16-bit signed integers for equality and, if they are equal, replaces the first value. + Compares two 16-bit signed integers for equality and, if they are equal, replaces the first value, as an atomic operation. The original value in . To be added. The address of is a pointer. @@ -1158,7 +1158,7 @@ If `comparand` and the object in `location1` are equal by reference, then `value The destination, whose value is compared with and possibly replaced. The value that replaces the destination value if the comparison results in equality. The value that is compared to the value at . - Compares two 32-bit unsigned integers for equality and, if they are equal, replaces the first value. + Compares two 32-bit unsigned integers for equality and, if they are equal, replaces the first value, as an atomic operation. The original value in . To be added. The address of is a pointer. @@ -1204,7 +1204,7 @@ If `comparand` and the object in `location1` are equal by reference, then `value The destination, whose value is compared with and possibly replaced. The value that replaces the destination value if the comparison results in equality. The value that is compared to the value at . - Compares two 64-bit unsigned integers for equality and, if they are equal, replaces the first value. + Compares two 64-bit unsigned integers for equality and, if they are equal, replaces the first value, as an atomic operation. The original value in . To be added. The address of is a pointer. @@ -1248,7 +1248,7 @@ If `comparand` and the object in `location1` are equal by reference, then `value The destination , whose value is compared with the value of and possibly replaced by . The that replaces the destination value if the comparison results in equality. The that is compared to the value at . - Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one. + Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one, as an atomic operation. The original value in . To be added. The address of is a pointer. @@ -1326,7 +1326,7 @@ If `comparand` and the object in `location1` are equal by reference, then `value The destination, whose value is compared by reference with and possibly replaced. This is a reference parameter ( in C#, in Visual Basic). The value that replaces the destination value if the comparison by reference results in equality. The value that is compared by reference to the value at . - Compares two instances of the specified reference type for reference equality and, if they are equal, replaces the first one. + Compares two instances of the specified reference type for reference equality and, if they are equal, replaces the first one, as an atomic operation. The original value in . Date: Tue, 13 Aug 2024 20:43:06 -0700 Subject: [PATCH 3/3] Clarify IStream::Write doc (#10249) --- .../IStream.xml | 128 +++++++++--------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/xml/System.Runtime.InteropServices.ComTypes/IStream.xml b/xml/System.Runtime.InteropServices.ComTypes/IStream.xml index ae4e8fd3c96..47ad068efe9 100644 --- a/xml/System.Runtime.InteropServices.ComTypes/IStream.xml +++ b/xml/System.Runtime.InteropServices.ComTypes/IStream.xml @@ -64,13 +64,13 @@ Provides the managed definition of the interface, with functionality. - IStream @@ -122,11 +122,11 @@ When this method returns, contains the new stream object. This parameter is passed uninitialized. Creates a new stream object with its own seek pointer that references the same bytes as the original stream. - @@ -176,11 +176,11 @@ A value that controls how the changes for the stream object are committed. Ensures that any changes made to a stream object that is open in transacted mode are reflected in the parent storage. - @@ -236,11 +236,11 @@ On successful return, contains the actual number of bytes written to the destination. Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream. - @@ -294,11 +294,11 @@ The requested restrictions on accessing the range. Restricts access to a specified range of bytes in the stream. - @@ -350,14 +350,14 @@ When this method returns, contains the data read from the stream. This parameter is passed uninitialized. The number of bytes to read from the stream object. - A pointer to a variable that receives the actual number of bytes read from the stream object. + A pointer to an variable that receives the actual number of bytes read from the stream object. Reads a specified number of bytes from the stream object into memory starting at the current seek pointer. - @@ -404,11 +404,11 @@ Discards all changes that have been made to a transacted stream since the last call. - @@ -462,11 +462,11 @@ On successful return, contains the offset of the seek pointer from the beginning of the stream. Changes the seek pointer to a new location relative to the beginning of the stream, to the end of the stream, or to the current seek pointer. - @@ -516,11 +516,11 @@ The new size of the stream as a number of bytes. Changes the size of the stream object. - @@ -572,11 +572,11 @@ Members in the structure that this method does not return, thus saving some memory allocation operations. Retrieves the structure for this stream. - @@ -630,11 +630,11 @@ The access restrictions previously placed on the range. Removes the access restriction on a range of bytes previously restricted with the method. - @@ -685,14 +685,14 @@ The buffer to write this stream to. The number of bytes to write to the stream. - On successful return, contains the actual number of bytes written to the stream object. If the caller sets this pointer to , this method does not provide the actual number of bytes written. + A pointer to a variable where this method writes the actual number of bytes written to the stream object. The caller can set this pointer to , in which case this method does not provide the actual number of bytes written. Writes a specified number of bytes into the stream object starting at the current seek pointer. -