Disposable is a ruby gem, which provides decorators on top of ORM layer.
Questions tagged [disposable]
61 questions
3
votes
1 answer
C# disposable pattern for C++ object destruction
I came across this implementation of disposable pattern provided by microsoft: https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx
using System;
class BaseClass : IDisposable
{
// Flag: Has Dispose already been called?
…

user2443626
- 93
- 1
- 7
3
votes
2 answers
Is there a way to find out if an object has been dispose() or not?
I have the following object that later in my code I want to dispose() IF it exists. Is there a way to find if it exists?
Public objExcel As Excel.Application
The best I could come up with is to put the disposal into a try...catch block like…

ScotterMonkey
- 1,007
- 12
- 25
2
votes
1 answer
How to make an object disposable in Dart?
I have an abstract class named AbstractFoo and its implementation, Foo. Foo also implements an interface Bar. I would like to make Foo disposable so I assume that I need to implement Disposable class but I am getting an error
Classes and mixins can…

Themelis
- 4,048
- 2
- 21
- 45
2
votes
1 answer
Where to clear CompositeDisposable in RecyclerView.Adapter
Consider we have some Disposable in our RecyclerView.Adapter and we added them to a CompositeDisposable.
which Adapter method callback is the best choice to clear() the CompositeDisposable ?
Currently I did on the onDetachedFromRecyclerView. I want…

alizeyn
- 2,300
- 1
- 20
- 30
2
votes
0 answers
How do you properly dispose of a CancellationTokenSource in a ViewModel?
Typically, when you are trying to do asynchronous tasks in a view-model, the code looks like so (simplified):
public class MyViewModel
{
private CancellationTokenSource CTS { get; set; }
public async Task Process()
{
CTS = new…

michael
- 14,844
- 28
- 89
- 177
2
votes
3 answers
Dispose x Close
In overall cases, the Close method semantically just change the state of a object that can be changed again with the Open method, indefinitely.
In other hand the semantics of IDisposable.Dispose() method put the object in a state that cannot be…

Luciano
- 2,695
- 6
- 38
- 53
2
votes
1 answer
Removing old-fashioned finalizers
In an almost 10 year old system, I've implemented several IDisposable implementations. Back in the old days, when I was younger and still foolish, the trend was to implement a finalizer as well:
class MyClass: IDisposable
{
public void Dispose()…

zmbq
- 38,013
- 14
- 101
- 171
2
votes
1 answer
ServiceContext and OrganizationServiceProxy in Session
I have an ASP.Net app that allows users to interact with Dynamics CRM 2011 data through early bound entities.
I am currently storing the ServiceContext and OrganizationServiceProxy in session, the reason for this is that I have to get objects of a…

Mauro
- 4,531
- 3
- 30
- 56
1
vote
2 answers
Does userControl1.Dispose() take care of all its disposable objects?
i have made a userControl library .. and it contains NetworkStream, StreamReader, FileStream
So do i have to Dispose them all when the form that has this userControl closes ??
I mean There's no such Form1_FormClosing(object…

Murhaf Sousli
- 12,622
- 20
- 119
- 185
1
vote
0 answers
Issue with Decoding H.263 Sorenson Spark D frames
I am trying to decode the H.263 sorenson type of data using avcodec_decode_video function.
It is able to decode the I and P frames but i have some D frames (Disposable inter frames) in my data and this function is not able to decode these frames and…

nitin goyal
- 11
- 2
1
vote
1 answer
IDisposable questions about specific case
Question #1:
StartAsync handles the disposal of _clientWebSocket and _tokenSource. So do I really need to dispose these in Dispose() as well? I think I should keep _semaphore.Dispose() only in the Dispose(), because my code already handles the…

nop
- 4,711
- 6
- 32
- 93
1
vote
0 answers
Kotlin how to cancel multiples rx disposable in a classe
So i have a disposable in my classe declared like this : private var disposable = Disposables.disposed()
And i use it like this :
disposable = fileDownloader.download()
.toFlowable(BackpressureStrategy.LATEST)
…

XCarb
- 735
- 10
- 31
1
vote
1 answer
Inheriting from Stephen Cleary's Nito.Disposables NuGet package
I saw the implementation of Stephen Cleary's Disposables NuGet package and it seems like it's perfect in my case, even tho, I couldn't find examples on how to inherit from it.
My idea is to make UnsubscribeAsync().GetAwaiter().GetResult(); to await…

nop
- 4,711
- 6
- 32
- 93
1
vote
0 answers
How to dispose unsent messages in a queue in C#
I am using a concurrent queue in my C# Web API. I want to handle the situation where in case of a graceful shutdown, I should be able to empty my queue, process it and dispose it off.
Below is my code snippet where I am trying to dispose and write…

LeoCoder123
- 11
- 1
1
vote
0 answers
How to show (identify easily) `Disposable` variables within Visual Studio?
[I have searched similar questions, but most of them seem at least 5 years old. The most near seemed this answer but it is not clear answer and is 5yrs old]
My question: What should we do if we want Visual Studio showed (I)Disposable variables and…

T.Todua
- 53,146
- 19
- 236
- 237