finalizer Questions
5
Solved
I have the following class which is a decorator for an IDisposable object (I have omitted the stuff it adds) which itself implements IDisposable using a common pattern:
public class DisposableDeco...
Weatherboarding asked 24/5, 2010 at 9:7
4
Solved
I have a class in C# where I want to close out some communication ports properly when my class is being disposed. However, the finalizer is never being called when I exit the program. Why is that? ...
4
Solved
As there is little guarantee about when and even if finalizers run and finalizers are almost considered a smell nowadays - is there any way to persuade the JVM to completely skip all finalization p...
Latarsha asked 6/1, 2014 at 12:31
1
Solved
I'm reading Effective Java by Joshua Bloch. In ITEM 8: AVOID FINALIZERS AND CLEANERS of CHAPTER 2 he states:
Finalizers have a serious security problem: they open your class up to
finalizer attack...
Unnecessarily asked 24/11, 2022 at 0:7
3
Solved
I ran a heap dump on my program. When I opened it in the memory analyzer tool, I found that the java.lang.ref.Finalizer for org.logicalcobwebs.proxool.ProxyStatement was taking up a lot of memory. ...
7
Solved
From Python documentation:
It is not guaranteed that __del__() methods are called for objects that still exist when the interpreter exits.
As far as I understand, there is also no way to guara...
Underrate asked 28/2, 2020 at 9:24
3
Solved
I am translating a C# class that wraps an unmanaged library to F#. I have run into the seemingly simple problem of rewriting the destructor that follows.
class Wrapper {
// P/Invoke ellided
pr...
3
Solved
We recently upgraded our message processing application from Java 7 to Java 8. Since the upgrade, we get an occasional exception that a stream has been closed while it is being read from. Logging s...
Danit asked 29/10, 2014 at 23:1
1
Solved
I have a bunch of instances, each having a unique tempfile for its use (save data from memory to disk and retrieve them later).
I want to be sure that at the end of the day, all these files are rem...
Lucrative asked 7/6, 2021 at 8:27
2
Solved
Quote from MSDN:
If Finalize or an override of Finalize throws an exception, the runtime ignores the exception, terminates that Finalize method, and continues the finalization process.
Yet if I h...
Recti asked 22/4, 2010 at 15:9
5
Solved
I am relatively new to WPF, and some things with it are quite foreign to me. For one, unlike Windows Forms, the WPF control hierarchy does not support IDisposable. In Windows Forms, if a user contr...
Ratel asked 11/10, 2009 at 8:56
2
We have a Java API that is a wrapper around a C API.
As such, we end up with several Java classes that are wrappers around C++ classes.
These classes implement the finalize method in order to free ...
Davies asked 8/10, 2020 at 14:33
2
Solved
Suppose I have some asm.js code, probably created by emscripten. Suppose it has some kind of rather large heap allocated structure, which gets returned by a asm.js function as a pointer that is pic...
Trug asked 28/11, 2013 at 12:46
1
Solved
(This question is different from Why would you ever implement finalize()? This question is about deprecation from the Java platform, and the other question is about whether one should use this mech...
Gelding asked 14/5, 2019 at 23:8
1
Solved
I have a TestNet wrapper for a native component. The native component exposes a blocking TestNative::Foo() that communicates with managed part through calling managed callbacks and a weak GCHandle ...
Dairymaid asked 1/6, 2019 at 9:52
2
Solved
.NET has a function called GC.KeepAlive(Object). Its sole purpose is to ensure the lifetime of the referenced object lasts until code flow reaches the call.
This is normally not necessary unless o...
Ervin asked 17/3, 2014 at 14:28
2
Solved
We're seeing a weird AddressSanitizer (clang/C++) "heap-use-after-free" violation that might relate to a finalizer corner case.
Let's say, a Java object OBJ has a handle to to a native resource X....
Rote asked 28/11, 2017 at 13:8
4
I've read carefully through this article and it seems to clearly state that the dispose pattern should be implemented in all cases of IDisposable implementation. I'm trying to understand why I need...
Diaz asked 16/4, 2019 at 16:0
0
This is a follow-up question from this one.
Specifically I'm trying to verify correct use of an API which involves calling close() on Java objects holding heavy native resources over JNI. To re-it...
Moonstone asked 12/2, 2019 at 14:1
1
Solved
I have following Fortran code
type t_octree
integer :: max_num_point
class(t_octree_node), pointer :: root => null()
contains
final :: DESTROY_OCTREE
end type t_octree
type t_octree_nod...
Eclair asked 27/12, 2018 at 21:48
4
Solved
In Java, overriding the finalize method gets a bad rap, although I don't understand why. Classes like FileInputStream use it to ensure close gets called, in both Java 8 and Java 10. Nevertheless, J...
Aires asked 18/10, 2018 at 17:45
2
I'm trying to provision/deprovision service instance/binding from my cloud provider (IBM cloud private), Currently, there is a bug that if the service is not deprovisioned in ICP, that leaves me th...
Catalonia asked 15/10, 2018 at 14:51
2
Solved
From the documentation ?reg.finalizer in R:
Inter alia, it provides a way to program code to be run at the end of an R session without manipulating .Last. For use in a package, it is often a goo...
1
Solved
I thought that Rakudo got finalizer support several years ago but I couldn't find the documentation for it (maybe it goes in Classes and Objects). Listing all the methods in a class didn't seem lik...
4
Solved
Object.finalize() is deprecated in Java 9, and I think I understand the reasons why, but I'm having trouble seeing how to replace it.
I have a utility class called Configuration which essentially ...
Dentilingual asked 11/12, 2017 at 23:16
1 Next >
© 2022 - 2024 — McMap. All rights reserved.