Click here to Skip to main content
15,889,216 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: "The feature you are trying to use ..." Error Pin
Dave Kreskowiak17-Oct-16 13:10
mveDave Kreskowiak17-Oct-16 13:10 
Question.net freelancer Pin
Member 1278822911-Oct-16 11:06
Member 1278822911-Oct-16 11:06 
AnswerRe: .net freelancer Pin
Dave Kreskowiak11-Oct-16 11:22
mveDave Kreskowiak11-Oct-16 11:22 
AnswerRe: .net freelancer Pin
Eddy Vluggen12-Oct-16 7:05
professionalEddy Vluggen12-Oct-16 7:05 
QuestionNested Components - Winforms Pin
Midi_Mick10-Oct-16 6:47
professionalMidi_Mick10-Oct-16 6:47 
AnswerRe: Nested Components - Winforms Pin
Midi_Mick11-Oct-16 0:24
professionalMidi_Mick11-Oct-16 0:24 
QuestionLife of IDisposable object members Pin
Midi_Mick2-Oct-16 7:25
professionalMidi_Mick2-Oct-16 7:25 
AnswerRe: Life of IDisposable object members Pin
Nathan Minier3-Oct-16 1:28
professionalNathan Minier3-Oct-16 1:28 
Your example will result in some problems, and has some structural issues.

First, if Image is disposable, then any class that uses it should either be disposable as well or implement a finalization strategy for Image, i.e. ObjectA needs to handle the ImageA memory usage in some way.

Second, without a finalizer on ObjectB (namely ~ObjectB(){Dispose();}) or an explicit call to objB.Dispose(); you never properly dispose of objB and any unmanaged resources handled by it are not released. Simply falling out of scope will not clear these things for you, and it would be a memory leak.

In this instance, you would want to perform a deep copy of ImageB rather than a reference assignment (a copy constructor would make life easy), as if objB were properly disposed, ImageB would be disposed and ImageA is a reference assignment to ImageB. This means that any expected functionality is now kaput, and ImageA were designed correctly it would attempt to disposed of an already disposed object, also a bad thing.

Please take a look at:
Dispose Pattern[^]

Implementing a Dispose Method[^]
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli

GeneralRe: Life of IDisposable object members Pin
Midi_Mick3-Oct-16 1:41
professionalMidi_Mick3-Oct-16 1:41 
GeneralRe: Life of IDisposable object members Pin
Nathan Minier3-Oct-16 1:46
professionalNathan Minier3-Oct-16 1:46 
QuestionControl Designers Pin
Midi_Mick27-Sep-16 4:02
professionalMidi_Mick27-Sep-16 4:02 
AnswerRe: Control Designers Pin
Gerry Schmitz28-Sep-16 13:26
mveGerry Schmitz28-Sep-16 13:26 
Questioninteroperation / Loading and unloading WPF assembly from arbitrary path Pin
achimschoen22-Sep-16 5:44
professionalachimschoen22-Sep-16 5:44 
AnswerRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
NotPolitcallyCorrect22-Sep-16 6:29
NotPolitcallyCorrect22-Sep-16 6:29 
GeneralRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
achimschoen22-Sep-16 6:44
professionalachimschoen22-Sep-16 6:44 
GeneralRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
NotPolitcallyCorrect22-Sep-16 7:02
NotPolitcallyCorrect22-Sep-16 7:02 
GeneralRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
achimschoen22-Sep-16 22:09
professionalachimschoen22-Sep-16 22:09 
AnswerRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
#realJSOP22-Sep-16 6:41
mve#realJSOP22-Sep-16 6:41 
AnswerRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
Gerry Schmitz22-Sep-16 7:12
mveGerry Schmitz22-Sep-16 7:12 
GeneralRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
achimschoen22-Sep-16 22:17
professionalachimschoen22-Sep-16 22:17 
GeneralRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
Gerry Schmitz24-Sep-16 6:16
mveGerry Schmitz24-Sep-16 6:16 
AnswerRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
Bernhard Hiller22-Sep-16 21:02
Bernhard Hiller22-Sep-16 21:02 
AnswerRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
Pete O'Hanlon22-Sep-16 21:41
mvePete O'Hanlon22-Sep-16 21:41 
GeneralRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
achimschoen22-Sep-16 21:57
professionalachimschoen22-Sep-16 21:57 
GeneralRe: interoperation / Loading and unloading WPF assembly from arbitrary path Pin
Pete O'Hanlon23-Sep-16 2:29
mvePete O'Hanlon23-Sep-16 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.