On 12/13/14 2:03 AM, Andrey Derzhavin wrote:
Hello!
We have object, for example, objA.
ObjectAType objA = new ObjectAType(...);
// we have a many references to objA
void someFunction1(...)
{
// destroying the objA
destroy(one_of_the_refToObjA);
//
}
void
Thank you very much, Steven!
On Saturday, 13 December 2014 at 21:20:43 UTC, Andrey Derzhavin
wrote:
import std.stdio;
class ObjectAType {
bool ok;
this() {ok = true;}
}
void main()
{
auto a = new ObjectAType;
assert(a.ok);
destroy(a);
assert(!a.ok); // a has been destroyed.
}
This method of
Marc Schütz\ schue...@gmx.net writes:
On Saturday, 13 December 2014 at 21:20:43 UTC, Andrey Derzhavin wrote:
import std.stdio;
class ObjectAType {
bool ok;
this() {ok = true;}
}
void main()
{
auto a = new ObjectAType;
assert(a.ok);
destroy(a);
assert(!a.ok); // a
On Sunday, 14 December 2014 at 16:05:13 UTC, Dan Olson wrote:
Marc Schütz\ schue...@gmx.net writes:
On Saturday, 13 December 2014 at 21:20:43 UTC, Andrey
Derzhavin wrote:
import std.stdio;
class ObjectAType {
bool ok;
this() {ok = true;}
}
void main()
{
auto a = new ObjectAType;
import std.stdio;
class ObjectAType {
bool ok;
this() {ok = true;}
}
void main()
{
auto a = new ObjectAType;
assert(a.ok);
destroy(a);
assert(!a.ok); // a has been destroyed.
}
This method of detection of collected objects is what I needed.
Thanks to everybody for
Hello!
We have object, for example, objA.
ObjectAType objA = new ObjectAType(...);
// we have a many references to objA
void someFunction1(...)
{
// destroying the objA
destroy(one_of_the_refToObjA);
//
}
void someFunction2()
{
// segmentation fault if the objA is
On Sat, 13 Dec 2014 07:03:22 +
Andrey Derzhavin via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Hello!
We have object, for example, objA.
ObjectAType objA = new ObjectAType(...);
// we have a many references to objA
void someFunction1(...)
{
// destroying
On Sat, 13 Dec 2014 07:03:22 +
Andrey Derzhavin via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
p.s. you can emulate weak links if this is what you want to have.
i.e. references to object that will not stop GC to collect that object
and which will be auto-nullified if the
On Sat, 13 Dec 2014 07:03:22 +
Andrey Derzhavin via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
p.p.s. please-please-please don't invent other hacks with
`rt_attachDisposeEvent()`! such hackery will not do you good in the
long term.
signature.asc
Description: PGP signature
10 matches
Mail list logo