X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/5d7ab8e936e5f667483efbf0f0dc947ae33e415e..d33e712baf74fc969d1c34172b01f66a5f6bbab9:/gtk/gtktree.lisp?ds=sidebyside diff --git a/gtk/gtktree.lisp b/gtk/gtktree.lisp index 89e103b..5a7f832 100644 --- a/gtk/gtktree.lisp +++ b/gtk/gtktree.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtktree.lisp,v 1.29 2007-08-20 11:20:21 espen Exp $ +;; $Id: gtktree.lisp,v 1.31 2007-10-17 14:47:10 espen Exp $ (in-package "GTK") @@ -255,11 +255,12 @@ location)) (defun %tree-path-to-vector (location) - (let ((indices (%tree-path-get-indices location)) - (depth (%tree-path-get-depth location))) - (if (null-pointer-p indices) - #() - (map-c-vector 'vector #'identity indices 'int depth)))) + (unless (null-pointer-p location) + (let ((indices (%tree-path-get-indices location)) + (depth (%tree-path-get-depth location))) + (if (null-pointer-p indices) + #() + (map-c-vector 'vector #'identity indices 'int depth))))) (defmacro %with-tree-path ((var path) &body body) (let* ((pointer-offset (adjust-offset (size-of 'int) 'pointer)) @@ -383,6 +384,11 @@ (model tree-model) (iter tree-iter :in/return) (path tree-path)) + +(defmethod allocate-foreign ((tree-iter tree-iter) &rest initargs) + (declare (ignore initargs)) + (let ((size (foreign-size (class-of tree-iter)))) + (slice-alloc size))) (defun ensure-tree-iter (model row) (etypecase row