Questions tagged [destruction]
75 questions
1
vote
3 answers
Classes with static members containing static members in C++
I have a class which contains a static member 'obj'. The static class member obj itself contains a static member (which happens to be a mutex type of class).
Now when my program terminates it is crashes. This happens when static object 'obj' gets…

Jeff
- 11
- 2
1
vote
2 answers
Handle object destruction on the stack
I'm currently writing a compiler front end for personal education on the topic and I've run into a problem concerning the way I handle BNF definition in C++ through operator overloading.
Currently my setup is as follows:
Rule.h:
class…

Mathias Vorreiter Pedersen
- 780
- 8
- 22
1
vote
1 answer
Static destruction of local-static object
Help me understand this... see bold. From the Standard 3.6.3 Termination (2)
2 If a function contains a block-scope object of static or thread
storage duration that has been destroyed and the function is called
during the destruction of an…

clanmjc
- 299
- 1
- 9
0
votes
3 answers
Why can't I delete the current element when iterating over a list?
I want to iterate over a list, perform an action with the elements and based on some criteria, I want to get rid of the active element. However, when using the function below I end up in an infinite loop.
(defun foo (list action test)
(do ((elt…

quartus
- 67
- 7
0
votes
1 answer
How to destructure Kotlin nested pairs with forEach
I need to destructure Kotlin nested pairs. How can I do this simply without using pair.first/pair.second?
val chars = listOf('A', 'B', 'C')
val ints = listOf(1, 2, 3)
val booleans = listOf(true, false, false)
val cib: List,…

AndroidDev
- 35
- 5
0
votes
0 answers
react-refresh-runtime.development.js:315 Uncaught TypeError: Cannot read properties of undefined
hello guys I'm quite new to react but this error is working outside an useEffect and an useState hook can someone please tell me whats the problem with my code which it cannot enter the useEffect loop and before that we face error however if I…

Amirns
- 1
0
votes
0 answers
JS backward string interpolation
I'm going to parse a big custom-formed config from txt to class, adjust it in Form and then save it back. Saving is not a problem, I can use Interpolation and this is awesome.
After this, I just wondered if I can do a backward interpolation, like…

Anton Nikitsiuk
- 59
- 3
0
votes
1 answer
Python Deep Destruction Like JavaScript and assingment to new Object
let newJson = {};
({
"foo": {
"name": newJson.FirstName,
"height": newJson.RealHeight
}
} =
{
"foo": {
"name": "Felipe",
"height": "55"
}
});
console.log({newJson})
As we Know the above code will…
0
votes
1 answer
Xna destructible walls
So I'm making a space invaders clone and I'm stuck on the wall part. I need to make destructible wall I don't know how to do it. So if anyone has any idea, it would be helpful to get some help from you people out there.

Aiden Koorsen
- 3
- 2
0
votes
1 answer
C++ deleting/(recursive) Object-Destruction -issues
I have problems understanding why the following code always throws this exception:
AddressSanitizer: attempting double-free
I guess I'm not getting some part of the new/delete process, but just can't figure it out.
Thanks for any help in advance…

mcaustria
- 123
- 6
0
votes
1 answer
How to avoid OnCreate method execution when activity has been opened previously (Xamarin.Android)?
I have two activities FirstActivity and SecondActivity. When I am in FirstActivty I call the SecondActivity like that:
var secondActivity = new Intent(this, typeof(SecondActivity));
secondActivity.PutExtra("someExtra",…

Montoolivo
- 137
- 2
- 3
- 15
0
votes
1 answer
How can I merge the destructed object keys again?
as you can see I have to destruct the getters which I need to sum them and get how much income they have.
here is an example code this is a getter in Vuex store, but this is not important it's rather related to javascript and not vue itself.
…

Kepi
- 116
- 9
0
votes
3 answers
How can I delete an object from a pointer to a pointer array?
I'm still new to manual destruction in C++ (came from languages with garbage collection). I have the following in one of my classes:
Input** Inputs;
Which gets initialized as follows:
this->Inputs = new Input* [totalInputs];
And can get reassigned…

Phillip McMullen
- 453
- 2
- 5
- 15
0
votes
1 answer
Idiomatic way to determine if an object has been destroyed
I've been trying to find a better way to accomplish determining if a particular object has been destroyed (destroy(...)). The way I've been doing it is like so:
class C {
bool valid = false;
this(){
valid = true;
}
}
Then you do:
C c…

t123
- 23
- 3
0
votes
2 answers
clojure - trouble destructing map inside macro
I'm a newbie in clojure, so please bear with me.
Writing a macro as so:
`(let [query# (:query-params ~'+compojure-api-request+)
options# (select-keys query# [:sort-by :from :to])])
First line of the let block destructures a query-params…

Sasha
- 1,500
- 4
- 14
- 25