Questions tagged [destroy]

In object-oriented languages, objects need to be destroyed after their creation to free memory. Destruction can however have a broader meaning. Sometimes, destruction means that resources must be freed or that files must be deleted.

In object-oriented languages, objects need to be destroyed after their creation to free memory. This is not necessarily something that a programmer needs to explicitly instruct. Garbage collected languages such as Java or Python take care of object destruction for you. Other languages such as C++ require the programer to destroy objects explicitly.

Destruction can however have a broader meaning. Sometimes, destruction means that resources must be freed or that files must be deleted.

982 questions
13
votes
1 answer

How to free and garbage collect a WebGL context?

I'm developing a WebGL application for web and mobile. I often use hard-refreshs to test the results of my WebGL implementation. After a view tries, I get the error: Error: WebGL: Exceeded 16 live WebGL contexts for this principal, losing the least…
q9f
  • 11,293
  • 8
  • 57
  • 96
12
votes
1 answer

Ruby on Rails -- undo mark_for_destruction

In my rails app the child records get marked_for_destruction I want to undo that action and unmark them. Is there a way? Thanks in advance.
Rohit
  • 5,631
  • 4
  • 31
  • 59
12
votes
3 answers

vuejs2: how can i destroy a watcher?

How can i destroy this watcher? I need it only one time in my child component, when my async data has loaded from the parent component. export default { ... watch: { data: function(){ this.sortBy(); }, }, …
Gregor Voinov
  • 2,203
  • 7
  • 34
  • 52
12
votes
3 answers

In rails, how to destroy a 'join table item' with out deleting the real record?

I get confuse now, I don't know how to delete/destroy a record in a join table: class Task < ActiveRecord::Base belongs_to :schema belongs_to :to_do end class Todo < ActiveRecord::Base belongs_to :schema has_many :tasks end class Schema <…
Croplio
  • 3,433
  • 6
  • 31
  • 37
11
votes
2 answers

Records in join table destroyed automatically in HABTM association?

Let's say I have an association where User has and belongs to many Roles. When I destroy the user, is the record in the join table automatically removed as well? Or do I need to use :dependent => :destroy? What about if I destroy a Role? class…
keruilin
  • 16,782
  • 34
  • 108
  • 175
11
votes
3 answers

backbone destroy not sending params

I've got a backbone model that I'm trying to destroy, but no params are being sent with the request, so the server is returning a 'Delete 404 not found' error. I'll admit my structure is a bit strange as I'm creating/destroying the items based on…
pedalpete
  • 21,076
  • 45
  • 128
  • 239
10
votes
4 answers

Android: Unable to destroy activity

I am using the following code to removes childs on every viewgroup: protected void onDestroy() { super.onDestroy(); this.liberarMemoria(); } public void liberarMemoria(){ imagenes.recycleBitmaps(); …
android iPhone
  • 860
  • 2
  • 11
  • 22
10
votes
4 answers

How to destroy/remove/unbind a Flexslider

There are a few discussions on the github page regarding the destroy method, and a couple questions on stack, but there hasn't been a straightforward answer or solution yet, that I was able to find after alot of searching. The current version of…
HandiworkNYC.com
  • 10,914
  • 25
  • 92
  • 154
10
votes
4 answers

Check if ActiveRecord object is destroyed using the .destroy() return value

I am maintaining someone's code base and they have something like this: if @widget_part.destroy flash[:message] = "Error deleting widget part" else flash[:message] = "Widget part destroyed successfully" end What does destroy return? Is it ok to…
highBandWidth
  • 16,751
  • 20
  • 84
  • 131
9
votes
5 answers

jQuery Tools -> Tooltip destroy method?

I am using Flowplayer's jQuery Tools framework (specifically the tooltips plugin) in a table, in addition to jQuery UI calendar. Each row of the table has the ability to insert a row above and below it. When doing this I am cloning the clicked…
redcloud1800
  • 123
  • 1
  • 1
  • 5
9
votes
4 answers

default_scope breaks (update|delete|destroy)_all in some cases

I believe this is a bug in Rails 3. I am hoping someone here can steer me in the correct direction. The code posted below, is purely for illustration of this problem. Hopefully this does not confuse the issue. Given I have a Post model, and a…
releod
  • 513
  • 5
  • 12
9
votes
7 answers

Destroy a PHP session on clicking a link

Is this code valid? Logout
mpsbhat
  • 2,733
  • 12
  • 49
  • 105
9
votes
1 answer

How do I destroy a jquery resizable without destroying child resizables?

I have a parent div which is resizable (width only) - within this div I have a number of other divs that are also resizable (height only). At times I want to either disable or destroy the parent width resizing but leave the inner height resizing in…
Nigel
  • 247
  • 1
  • 3
  • 12
8
votes
3 answers

Rails: how to overwrite :destroy method?

I tried lot of things to overwrite the behavior of the :destroy method but nothing works. I used first the acts_as_paranoia plugin, but it doesn't work with a model in a has_many :through association. I want to overwrite :destroy method just to do…
alex.bour
  • 2,842
  • 9
  • 40
  • 66
8
votes
2 answers

How to find out who ran the TFS Destroy Command?

I have reason to believe that the TFS Destroy command was run on my server. Does TFS provide a way to find out who and when it was done?
Vic Peters
  • 338
  • 3
  • 16
1 2
3
65 66