File tree Expand file tree Collapse file tree 17 files changed +63
-3
lines changed
Expand file tree Collapse file tree 17 files changed +63
-3
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,9 @@ public TimeSpan LoopPoints
335335 ////////////////////////////////////////////////////////////
336336 public override string ToString ( )
337337 {
338+ if ( CPointer == IntPtr . Zero )
339+ return MakeDisposedObjectString ( ) ;
340+
338341 return "[Music]" +
339342 " SampleRate(" + SampleRate + ")" +
340343 " ChannelCount(" + ChannelCount + ")" +
Original file line number Diff line number Diff line change @@ -270,6 +270,9 @@ public float Attenuation
270270 ////////////////////////////////////////////////////////////
271271 public override string ToString ( )
272272 {
273+ if ( CPointer == IntPtr . Zero )
274+ return MakeDisposedObjectString ( ) ;
275+
273276 return "[Sound]" +
274277 " Status(" + Status + ")" +
275278 " Loop(" + Loop + ")" +
Original file line number Diff line number Diff line change @@ -199,6 +199,9 @@ public short[] Samples
199199 ////////////////////////////////////////////////////////////
200200 public override string ToString ( )
201201 {
202+ if ( CPointer == IntPtr . Zero )
203+ return MakeDisposedObjectString ( ) ;
204+
202205 return "[SoundBuffer]" +
203206 " SampleRate(" + SampleRate + ")" +
204207 " ChannelCount(" + ChannelCount + ")" +
Original file line number Diff line number Diff line change 1+ using System ;
12using System . Collections . Generic ;
23
34namespace SFML . Audio
@@ -33,6 +34,9 @@ public SoundBuffer SoundBuffer
3334 ////////////////////////////////////////////////////////////
3435 public override string ToString ( )
3536 {
37+ if ( CPointer == IntPtr . Zero )
38+ return MakeDisposedObjectString ( ) ;
39+
3640 return "[SoundBufferRecorder]" +
3741 " SampleRate(" + SampleRate + ")" +
3842 " SoundBuffer(" + SoundBuffer + ")" ;
Original file line number Diff line number Diff line change @@ -126,6 +126,9 @@ public static bool IsAvailable
126126 ////////////////////////////////////////////////////////////
127127 public override string ToString ( )
128128 {
129+ if ( CPointer == IntPtr . Zero )
130+ return MakeDisposedObjectString ( ) ;
131+
129132 return "[SoundRecorder]" + " SampleRate(" + SampleRate + ")" ;
130133 }
131134
Original file line number Diff line number Diff line change @@ -237,6 +237,9 @@ public Time PlayingOffset
237237 ////////////////////////////////////////////////////////////
238238 public override string ToString ( )
239239 {
240+ if ( CPointer == IntPtr . Zero )
241+ return MakeDisposedObjectString ( ) ;
242+
240243 return "[SoundStream]" +
241244 " SampleRate(" + SampleRate + ")" +
242245 " ChannelCount(" + ChannelCount + ")" +
Original file line number Diff line number Diff line change @@ -354,7 +354,13 @@ public void FlipVertically()
354354 /// </summary>
355355 /// <returns>String description of the object</returns>
356356 ////////////////////////////////////////////////////////////
357- public override string ToString ( ) => $ "[Image] Size({ Size } )";
357+ public override string ToString ( )
358+ {
359+ if ( CPointer == IntPtr . Zero )
360+ return MakeDisposedObjectString ( ) ;
361+
362+ return $ "[Image] Size({ Size } )";
363+ }
358364
359365 ////////////////////////////////////////////////////////////
360366 /// <summary>
Original file line number Diff line number Diff line change @@ -497,6 +497,9 @@ public void ResetGLStates()
497497 ////////////////////////////////////////////////////////////
498498 public override string ToString ( )
499499 {
500+ if ( CPointer == IntPtr . Zero )
501+ return MakeDisposedObjectString ( ) ;
502+
500503 return "[RenderTexture]" +
501504 " Size(" + Size + ")" +
502505 " Texture(" + Texture + ")" +
Original file line number Diff line number Diff line change @@ -716,6 +716,9 @@ public Image Capture()
716716 ////////////////////////////////////////////////////////////
717717 public override string ToString ( )
718718 {
719+ if ( CPointer == IntPtr . Zero )
720+ return MakeDisposedObjectString ( ) ;
721+
719722 return "[RenderWindow]" +
720723 " Size(" + Size + ")" +
721724 " Position(" + Position + ")" +
@@ -802,6 +805,8 @@ protected override void Destroy(bool disposing)
802805 {
803806 myDefaultView . Dispose ( ) ;
804807 }
808+
809+ myDefaultView = null ;
805810 }
806811
807812 ////////////////////////////////////////////////////////////
Original file line number Diff line number Diff line change @@ -712,6 +712,9 @@ public static bool IsGeometryAvailable
712712 ////////////////////////////////////////////////////////////
713713 public override string ToString ( )
714714 {
715+ if ( CPointer == IntPtr . Zero )
716+ return MakeDisposedObjectString ( ) ;
717+
715718 return "[Shader]" ;
716719 }
717720
You can’t perform that action at this time.
0 commit comments