Questions tagged [destruction]

70 questions
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
  • 289
  • 1
  • 8
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

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.
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
  • 1
  • 3
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
  • 107
  • 2
  • 2
  • 11
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. …
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
  • 303
  • 3
  • 13
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,100
  • 2
  • 12
  • 23
0
votes
2 answers

Why does the value of session variable remain even after all the code of destruction?

login.aspx if (IsPostBack == false) { //destroy any login information Session["password"] = "false"; Session["login"] = "false"; Session.Abandon(); Session.RemoveAll(); } if (TextBox2.Text ==…
user287745
  • 2,847
  • 9
  • 49
  • 97
0
votes
1 answer

How to make it so the Virtual Machine doesn't store its files in the real computer

My friends and i had a idea that we could do our own version of Windows Destruction. Except we don't know how to make it so the real computer itself doesn't get those viruses too. How could we do this?
Jacklack3
  • 9
  • 4
0
votes
1 answer

how python manage object delete or destruction

guys, I am rather new to python and learning it to build a gui application (with wypython). I have a question related with object destruction in python. e.g. in myFrame I have onNew (create a new document) and onOpen (open a file) method. briefly,…
pepero
  • 5,923
  • 6
  • 36
  • 68
0
votes
1 answer

How do I avoid deleting a pointer twice when two classes share the same heap object?

How do I avoid deleting a pointer twice when two classes share the same heap object? I've encountered this kind of problem: two large class objects share one large object. The are initialized in initial function. Because it is large, so I don't want…
Bill Banks
  • 25
  • 1
  • 6
0
votes
2 answers

C++ basic pointer question

I have some shared pointer shared_ptr pointer1(new T(1));. Now, in some other part of code I have an explicit copy of pointer2 (guess it would be stored in a std::map or some other container). Let's say that copy was done like…
Yippie-Ki-Yay
  • 20,062
  • 23
  • 85
  • 143
0
votes
0 answers

Deallocate SWIG wrapped object once the python host object is dereferenced?

I tried swig wrap a C++ class like this: class Test { public: Test() {printf("Construct\n");} ~Test() {printf("Deconstruct\n");} }; Suppose the swig wrapped module is pytest, I tried the following code: x = dict(a=pytest.Test()) del x I see…
shaoyl85
  • 1,594
  • 10
  • 26