[svn:parrot] r48704 - trunk/src/pmc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sat Aug 28 02:14:58 UTC 2010


Author: chromatic
Date: Sat Aug 28 02:14:58 2010
New Revision: 48704
URL: https://trac.parrot.org/parrot/changeset/48704

Log:
[PMC] Cleaned up ParrotLibrary destroy().

Also removed some unused POD sections.

Modified:
   trunk/src/pmc/parrotlibrary.pmc

Modified: trunk/src/pmc/parrotlibrary.pmc
==============================================================================
--- trunk/src/pmc/parrotlibrary.pmc	Sat Aug 28 02:14:51 2010	(r48703)
+++ trunk/src/pmc/parrotlibrary.pmc	Sat Aug 28 02:14:58 2010	(r48704)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2009, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -49,9 +49,7 @@
 
 */
 
-    VTABLE void init() {
-        PObj_custom_destroy_SET(SELF);
-    }
+    VTABLE void init() {}
 
 /*
 
@@ -82,8 +80,14 @@
 
     VTABLE PMC *clone() {
         PMC * const dest     = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
-        PMC_oplib_init(dest) = PMC_oplib_init(SELF);
-        PMC_dlhandle(dest)   = PMC_dlhandle(SELF);
+
+        if (PMC_oplib_init(SELF))
+            PMC_oplib_init(dest) = PMC_oplib_init(SELF);
+
+        if (PMC_dlhandle(SELF)) {
+            PMC_dlhandle(dest)   = PMC_dlhandle(SELF);
+            PObj_custom_destroy_SET(dest);
+        }
 
         if (PMC_metadata(SELF))
             PMC_metadata(dest) = VTABLE_clone(INTERP, PMC_metadata(SELF));
@@ -126,7 +130,7 @@
 
 =item C<void *get_pointer()>
 
-Get the pointer to the shared library handle.
+Gets the pointer to the shared library handle.
 
 =cut
 
@@ -140,7 +144,7 @@
 
 =item C<void set_pointer(void *handle)>
 
-Set the pointer to the shared library handle.
+Sets the pointer to the shared library handle.
 
 =cut
 
@@ -148,6 +152,7 @@
 
     VTABLE void set_pointer(void *handle) {
         PMC_dlhandle(SELF) = handle;
+        PObj_custom_destroy_SET(SELF);
     }
 }
 
@@ -155,16 +160,6 @@
 
 =back
 
-=head1 SEE ALSO
-
-    Date:    Mon, 29 Sep 2003 14:37:11 -0400 (EDT)
-    Subject: Library loading and initialization sequence
-    From:    Dan Sugalski
-
-=head1 HISTORY
-
-Initial version by leo 2003.10.12.
-
 =cut
 
 */


More information about the parrot-commits mailing list